From 8f36a807751f018d9422b05848ce44480e10e721 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 9 May 2023 08:01:54 +0900 Subject: [PATCH] fix e2e test --- cypress/e2e/basic.cy.js | 23 ++++++++++++++++++- cypress/e2e/widgets.cy.js | 4 ++++ packages/frontend/src/components/MkDialog.vue | 4 ++-- .../frontend/src/components/MkModalWindow.vue | 2 +- .../src/components/MkUserSetupDialog.vue | 11 +++++---- 5 files changed, 35 insertions(+), 9 deletions(-) diff --git a/cypress/e2e/basic.cy.js b/cypress/e2e/basic.cy.js index e271894ec1..e5e3a466ac 100644 --- a/cypress/e2e/basic.cy.js +++ b/cypress/e2e/basic.cy.js @@ -159,10 +159,31 @@ describe('After user signed in', () => { }); it('successfully loads', () => { - cy.get('[data-cy-open-post-form]').should('be.visible'); + cy.get('[data-cy-user-setup-continue]').should('be.visible'); + }); + + it('account setup wizard', () => { + cy.get('[data-cy-user-setup-continue]').click(); + + cy.get('[data-cy-user-setup-user-name] input').type('ありす'); + cy.get('[data-cy-user-setup-user-description] textarea').type('ほげ'); + // TODO: アイコン設定テスト + + cy.get('[data-cy-user-setup-continue]').click(); + + // フォローはスキップ + + cy.get('[data-cy-user-setup-continue]').click(); + + // プッシュ通知設定はスキップ + + cy.get('[data-cy-user-setup-continue]').click(); + + cy.get('[data-cy-user-setup-continue]').click(); }); it('note', () => { + cy.get('[data-cy-open-post-form]').should('be.visible'); cy.get('[data-cy-open-post-form]').click(); cy.get('[data-cy-post-form-text]').type('Hello, Misskey!'); cy.get('[data-cy-open-post-form-submit]').click(); diff --git a/cypress/e2e/widgets.cy.js b/cypress/e2e/widgets.cy.js index 88e19030c1..f5a982eb0a 100644 --- a/cypress/e2e/widgets.cy.js +++ b/cypress/e2e/widgets.cy.js @@ -10,6 +10,10 @@ describe('After user signed in', () => { cy.registerUser('alice', 'alice1234'); cy.login('alice', 'alice1234'); + + // アカウント初期設定ウィザード + cy.get('[data-cy-user-setup] [data-cy-modal-window-close]').click(); + cy.get('[data-cy-modal-dialog-ok]').click(); }); afterEach(() => { diff --git a/packages/frontend/src/components/MkDialog.vue b/packages/frontend/src/components/MkDialog.vue index 7b9aa862ef..9f5404ce15 100644 --- a/packages/frontend/src/components/MkDialog.vue +++ b/packages/frontend/src/components/MkDialog.vue @@ -32,8 +32,8 @@
- {{ okText ?? ((showCancelButton || input || select) ? i18n.ts.ok : i18n.ts.gotIt) }} - {{ cancelText ?? i18n.ts.cancel }} + {{ okText ?? ((showCancelButton || input || select) ? i18n.ts.ok : i18n.ts.gotIt) }} + {{ cancelText ?? i18n.ts.cancel }}
{{ action.text }} diff --git a/packages/frontend/src/components/MkModalWindow.vue b/packages/frontend/src/components/MkModalWindow.vue index f983f77750..1c942cfd0d 100644 --- a/packages/frontend/src/components/MkModalWindow.vue +++ b/packages/frontend/src/components/MkModalWindow.vue @@ -6,7 +6,7 @@ - +
diff --git a/packages/frontend/src/components/MkUserSetupDialog.vue b/packages/frontend/src/components/MkUserSetupDialog.vue index a9d117e073..c5e75276f0 100644 --- a/packages/frontend/src/components/MkUserSetupDialog.vue +++ b/packages/frontend/src/components/MkUserSetupDialog.vue @@ -3,6 +3,7 @@ ref="dialog" :width="500" :height="550" + data-cy-user-setup @close="close(true)" @closed="emit('closed')" > @@ -23,7 +24,7 @@
{{ i18n.ts._initialAccountSetting.accountCreated }}
{{ i18n.ts._initialAccountSetting.letsFillYourProfile }}
- {{ i18n.ts._initialAccountSetting.profileSetting }} + {{ i18n.ts._initialAccountSetting.profileSetting }}
@@ -32,7 +33,7 @@
- {{ i18n.ts.continue }} + {{ i18n.ts.continue }}
@@ -40,7 +41,7 @@
- {{ i18n.ts.continue }} + {{ i18n.ts.continue }}
@@ -52,7 +53,7 @@
{{ i18n.ts.pushNotification }}
{{ i18n.t('_initialAccountSetting.pushNotificationDescription', { name: instance.name ?? host }) }}
- {{ i18n.ts.continue }} + {{ i18n.ts.continue }} @@ -70,7 +71,7 @@
{{ i18n.t('_initialAccountSetting.haveFun', { name: instance.name ?? host }) }}
- {{ i18n.ts.close }} + {{ i18n.ts.close }}