2023-06-24 04:22:44 +00:00
|
|
|
describe("After user signed in", () => {
|
2022-05-28 05:28:12 +00:00
|
|
|
beforeEach(() => {
|
2022-05-31 08:57:01 +00:00
|
|
|
cy.resetState();
|
2023-06-24 04:22:44 +00:00
|
|
|
cy.viewport("macbook-16");
|
2022-05-28 05:28:12 +00:00
|
|
|
// インスタンス初期セットアップ
|
2023-06-24 04:22:44 +00:00
|
|
|
cy.registerUser("admin", "pass", true);
|
2022-05-28 05:28:12 +00:00
|
|
|
|
|
|
|
// ユーザー作成
|
2023-06-24 04:22:44 +00:00
|
|
|
cy.registerUser("alice", "alice1234");
|
2022-05-28 05:28:12 +00:00
|
|
|
|
2023-06-24 04:22:44 +00:00
|
|
|
cy.login("alice", "alice1234");
|
2022-05-28 05:28:12 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
afterEach(() => {
|
|
|
|
// テスト終了直前にページ遷移するようなテストケース(例えばアカウント作成)だと、たぶんCypressのバグでブラウザの内容が次のテストケースに引き継がれてしまう(例えばアカウントが作成し終わった段階からテストが始まる)。
|
|
|
|
// waitを入れることでそれを防止できる
|
|
|
|
cy.wait(1000);
|
|
|
|
});
|
|
|
|
|
2023-06-24 04:22:44 +00:00
|
|
|
it("widget edit toggle is visible", () => {
|
|
|
|
cy.get(".mk-widget-edit").should("be.visible");
|
|
|
|
});
|
2022-05-28 05:28:12 +00:00
|
|
|
|
2023-06-24 04:22:44 +00:00
|
|
|
it("widget select should be visible in edit mode", () => {
|
|
|
|
cy.get(".mk-widget-edit").click();
|
|
|
|
cy.get(".mk-widget-select").should("be.visible");
|
|
|
|
});
|
2022-05-28 05:28:12 +00:00
|
|
|
|
2023-06-24 04:22:44 +00:00
|
|
|
it("first widget should be removed", () => {
|
|
|
|
cy.get(".mk-widget-edit").click();
|
|
|
|
cy.get(".customize-container:first-child .remove._button").click();
|
|
|
|
cy.get(".customize-container").should("have.length", 2);
|
2022-05-28 05:28:12 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
function buildWidgetTest(widgetName) {
|
|
|
|
it(`${widgetName} widget should get added`, () => {
|
2023-06-24 04:22:44 +00:00
|
|
|
cy.get(".mk-widget-edit").click();
|
|
|
|
cy.get(".mk-widget-select select").select(widgetName, { force: true });
|
|
|
|
cy.get(".bg._modalBg.transparent").click({ multiple: true, force: true });
|
|
|
|
cy.get(".mk-widget-add").click({ force: true });
|
|
|
|
cy.get(`.mkw-${widgetName}`).should("exist");
|
2022-05-28 05:28:12 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2023-06-24 04:22:44 +00:00
|
|
|
buildWidgetTest("memo");
|
|
|
|
buildWidgetTest("notifications");
|
|
|
|
buildWidgetTest("timeline");
|
|
|
|
buildWidgetTest("calendar");
|
|
|
|
buildWidgetTest("rss");
|
|
|
|
buildWidgetTest("trends");
|
|
|
|
buildWidgetTest("clock");
|
|
|
|
buildWidgetTest("activity");
|
|
|
|
buildWidgetTest("photos");
|
|
|
|
buildWidgetTest("digitalClock");
|
|
|
|
buildWidgetTest("federation");
|
|
|
|
buildWidgetTest("postForm");
|
|
|
|
buildWidgetTest("slideshow");
|
|
|
|
buildWidgetTest("serverMetric");
|
|
|
|
buildWidgetTest("onlineUsers");
|
|
|
|
buildWidgetTest("jobQueue");
|
|
|
|
buildWidgetTest("button");
|
|
|
|
buildWidgetTest("aiscript");
|
2022-05-28 05:28:12 +00:00
|
|
|
});
|