From 4ec06635619eabf47e6158b628883cbca141bb1d Mon Sep 17 00:00:00 2001 From: unstoppa61e Date: Tue, 22 Mar 2022 15:56:16 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E3=81=AE=E9=87=8D=E8=A4=87=E3=82=92=E9=99=A4=E3=81=84=E3=81=9F?= =?UTF-8?q?=EF=BC=8FGitHub=20Actions=E3=81=A7=E8=90=BD=E3=81=A1=E3=81=9F?= =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=81=AE=E5=BE=85=E3=81=A1=E6=99=82?= =?UTF-8?q?=E9=96=93=E3=82=92=E9=95=B7=E3=81=8F=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cypress/integration/debug.spec.ts | 4 +- cypress/integration/modal.spec.ts | 30 ++++------ cypress/integration/review_play.spec.ts | 29 ---------- cypress/integration/stage_play.spec.ts | 70 ------------------------ cypress/integration/stage_select.spec.ts | 15 +++-- cypress/integration/url_access.spec.ts | 18 +++--- 6 files changed, 33 insertions(+), 133 deletions(-) delete mode 100644 cypress/integration/review_play.spec.ts delete mode 100644 cypress/integration/stage_play.spec.ts diff --git a/cypress/integration/debug.spec.ts b/cypress/integration/debug.spec.ts index e90682c..811a99c 100644 --- a/cypress/integration/debug.spec.ts +++ b/cypress/integration/debug.spec.ts @@ -2,7 +2,7 @@ describe('Debug', () => { context('when the user moves to stage 1', () => { it('does not show the debug button', () => { cy.visit('/stages/1') - cy.wait(500) + cy.wait(2000) cy.findByTestId('debug').should('not.exist') }) }) @@ -11,7 +11,7 @@ describe('Debug', () => { it('does not show the debug button', () => { cy.setLocalStorage('gorogoropanda.com/clearedStage', 'ttw'); cy.visit('/reviews/1') - cy.wait(500) + cy.wait(2000) cy.findByTestId('debug').should('not.exist') }) }) diff --git a/cypress/integration/modal.spec.ts b/cypress/integration/modal.spec.ts index 3fbe6aa..72f11f1 100644 --- a/cypress/integration/modal.spec.ts +++ b/cypress/integration/modal.spec.ts @@ -27,6 +27,7 @@ describe('Modal', () => { const clearReview = () => { for (let i = 0; i < 10; i++) { + cy.wait(1000) cy.findByTestId('start-answering').click() for (let j = 0; j < 5; j++) { clearWordplayByClicking(); @@ -38,8 +39,9 @@ describe('Modal', () => { context('when the user clicks "move to stage select" button', () => { it('moves to stage select page', () => { cy.visit('/stages/1') - cy.wait(500) + cy.wait(750) clearStage() + cy.wait(750) cy.findByTestId('move-to-stage-select-button').click() cy.url().should('eq', Cypress.config().baseUrl + '/') }) @@ -48,10 +50,11 @@ describe('Modal', () => { context('when the user clicks "move to next stage" button', () => { it('moves to stage 2', () => { cy.visit('/stages/1') - cy.wait(500) + cy.wait(750) clearStage() + cy.wait(750) cy.findByTestId('move-to-next-stage-button').click() - cy.wait(500) + cy.wait(750) cy.url().should('eq', Cypress.config().baseUrl + '/stages/2') }) }) @@ -62,35 +65,26 @@ describe('Modal', () => { it('moves to review 1', () => { cy.setLocalStorage('gorogoropanda.com/clearedStage', 'u51'); cy.visit('/stages/10') - cy.wait(500) + cy.wait(750) clearStage() + cy.wait(750) cy.findByTestId('move-to-next-stage-button').click() - cy.wait(500) + cy.wait(750) cy.url().should('eq', Cypress.config().baseUrl + '/reviews/1') }) }) }) context('when the user clears review 1', () => { - context('when the user clicks "move to stage select" button', () => { - it('moves to stage select page', () => { - cy.setLocalStorage('gorogoropanda.com/clearedStage', 'ttw'); - cy.visit('/reviews/1') - cy.wait(500) - clearReview() - cy.findByTestId('move-to-stage-select-button').click() - cy.url().should('eq', Cypress.config().baseUrl + '/') - }) - }) - context('when the user clicks "move to next stage" button', () => { it('moves to the finale page', () => { cy.setLocalStorage('gorogoropanda.com/clearedStage', 'ttw'); cy.visit('/reviews/1') - cy.wait(500) + cy.wait(2000) clearReview() + cy.wait(2000) cy.findByTestId('move-to-next-stage-button').click() - cy.wait(500) + cy.wait(2000) cy.url().should('eq', Cypress.config().baseUrl + '/thank-you-for-playing') }) }) diff --git a/cypress/integration/review_play.spec.ts b/cypress/integration/review_play.spec.ts deleted file mode 100644 index 5a44283..0000000 --- a/cypress/integration/review_play.spec.ts +++ /dev/null @@ -1,29 +0,0 @@ -describe('Review play', () => { - const clickCorrectNumberKey = () => { - cy.get('.bg-focused').children().children('.invisible').then(($correctNumberTile) => { - const correctNumber = $correctNumberTile.text() - cy.findByTestId(`number-key-${correctNumber}`).click() - }) - } - - const clearWordplayByClicking = () => { - for (let i = 0; i < 2; i++) { - clickCorrectNumberKey(); - } - } - - context('when the user clears ten sets', () => { - it('shows the modal', () => { - cy.setLocalStorage('gorogoropanda.com/clearedStage', 'ttw'); - cy.visit('/reviews/1') - cy.wait(500) - for (let i = 0; i < 10; i++) { - cy.findByTestId('start-answering').click() - for (let j = 0; j < 5; j++) { - clearWordplayByClicking(); - } - } - cy.findByTestId('modal').should('be.visible') - }) - }) -}) diff --git a/cypress/integration/stage_play.spec.ts b/cypress/integration/stage_play.spec.ts deleted file mode 100644 index 6754621..0000000 --- a/cypress/integration/stage_play.spec.ts +++ /dev/null @@ -1,70 +0,0 @@ -describe('Stage play', () => { - const clickCorrectNumberKey = () => { - cy.get('.bg-focused').children().children('.invisible').then(($correctNumberTile) => { - const correctNumber = $correctNumberTile.text() - cy.findByTestId(`number-key-${correctNumber}`).click() - }) - } - - const clearWordplayByClicking = () => { - for (let i = 0; i < 2; i++) { - clickCorrectNumberKey(); - } - } - - context('when the user clicks the start answering button', () => { - it('shows the review button', () => { - cy.visit('/stages/1') - cy.wait(500) - cy.findByTestId('start-answering').click() - cy.findByTestId('review').should('be.visible') - }) - - it('shows the keyboard', () => { - cy.visit('/stages/1') - cy.wait(500) - cy.findByTestId('start-answering').click() - cy.findByTestId('keyboard').should('be.visible') - }) - }) - - context('when the user clicks the start answering button and inputs two correct numbers by clicking number buttons', () => { - it('shows the keyboard', () => { - cy.visit('/stages/1') - cy.wait(500) - cy.findByTestId('start-answering').click() - clearWordplayByClicking(); - cy.findByTestId('start-answering').should('be.visible') - }) - }) - - context('when the user clears five wordplays continuously', () => { - it('levels up', () => { - cy.visit('/stages/1') - cy.wait(500) - for (let i = 0; i < 5; i++) { - cy.findByTestId('start-answering').click() - clearWordplayByClicking(); - } - cy.get('.text-ok').contains('レベルアップ') - }) - }) - - context('when the user clears fifteen sets', () => { - it('shows the modal', () => { - cy.visit('/stages/1') - cy.wait(500) - let level = 0; - for (const number of [5, 3, 3, 3, 1]) { - level++; - for (let i = 0; i < number; i++) { - cy.findByTestId('start-answering').click() - for (let j = 0; j < level; j++) { - clearWordplayByClicking(); - } - } - } - cy.findByTestId('modal').should('be.visible') - }) - }) -}) diff --git a/cypress/integration/stage_select.spec.ts b/cypress/integration/stage_select.spec.ts index 45ff71d..6319272 100644 --- a/cypress/integration/stage_select.spec.ts +++ b/cypress/integration/stage_select.spec.ts @@ -2,8 +2,9 @@ describe('Stage select', () => { context('when the user clicks stage 1 panel', () => { it('moves to stage 1', () => { cy.visit('/') - cy.wait(500) + cy.wait(2000) cy.findByTestId('stage-panel-1').click() + cy.wait(2000) cy.url().should('eq', Cypress.config().baseUrl + '/stages/1') }) }) @@ -12,8 +13,9 @@ describe('Stage select', () => { context('if stage 1 is not cleared yet', () => { it('remains home', () => { cy.visit('/') - cy.wait(500) + cy.wait(2000) cy.findByTestId('stage-panel-2').click() + cy.wait(2000) cy.url().should('eq', Cypress.config().baseUrl + '/') }) }) @@ -22,8 +24,9 @@ describe('Stage select', () => { it('moves to stage 2', () => { cy.setLocalStorage('gorogoropanda.com/clearedStage', 'gjj'); cy.visit('/') - cy.wait(500) + cy.wait(2000) cy.findByTestId('stage-panel-2').click() + cy.wait(2000) cy.url().should('eq', Cypress.config().baseUrl + '/stages/2') }) }) @@ -34,8 +37,9 @@ describe('Stage select', () => { it('remains home', () => { cy.setLocalStorage('gorogoropanda.com/clearedStage', 'u51'); cy.visit('/') - cy.wait(500) + cy.wait(2000) cy.findByTestId('review-panel-1').click() + cy.wait(2000) cy.url().should('eq', Cypress.config().baseUrl + '/') }) }) @@ -44,8 +48,9 @@ describe('Stage select', () => { it('moves to review 1', () => { cy.setLocalStorage('gorogoropanda.com/clearedStage', 'ttw'); cy.visit('/') - cy.wait(500) + cy.wait(2000) cy.findByTestId('review-panel-1').click() + cy.wait(2000) cy.url().should('eq', Cypress.config().baseUrl + '/reviews/1') }) }) diff --git a/cypress/integration/url_access.spec.ts b/cypress/integration/url_access.spec.ts index aa97c5b..201c8a7 100644 --- a/cypress/integration/url_access.spec.ts +++ b/cypress/integration/url_access.spec.ts @@ -2,7 +2,7 @@ describe('URL access', () => { context('when the user accesses stage 1 URL', () => { it('moves to stage 1', () => { cy.visit('/stages/1') - cy.wait(500) + cy.wait(750) cy.url().should('eq', Cypress.config().baseUrl + '/stages/1') }) }) @@ -11,7 +11,7 @@ describe('URL access', () => { context('if stage 1 is not cleared yet', () => { it('gets redirected home', () => { cy.visit('/stages/2') - cy.wait(500) + cy.wait(750) cy.url().should('eq', Cypress.config().baseUrl + '/') }) }) @@ -20,7 +20,7 @@ describe('URL access', () => { it('moves to stage 2', () => { cy.setLocalStorage('gorogoropanda.com/clearedStage', 'gjj'); cy.visit('/stages/2') - cy.wait(500) + cy.wait(750) cy.url().should('eq', Cypress.config().baseUrl + '/stages/2') }) }) @@ -30,7 +30,7 @@ describe('URL access', () => { context('if no stages are cleared yet', () => { it('gets redirected home', () => { cy.visit('/reviews/1') - cy.wait(500) + cy.wait(750) cy.url().should('eq', Cypress.config().baseUrl + '/') }) }) @@ -39,7 +39,7 @@ describe('URL access', () => { it('gets redirected home', () => { cy.setLocalStorage('gorogoropanda.com/clearedStage', 'u51'); cy.visit('/reviews/1') - cy.wait(500) + cy.wait(750) cy.url().should('eq', Cypress.config().baseUrl + '/') }) }) @@ -48,7 +48,7 @@ describe('URL access', () => { it('moves to review 1', () => { cy.setLocalStorage('gorogoropanda.com/clearedStage', 'ttw'); cy.visit('/reviews/1') - cy.wait(500) + cy.wait(750) cy.url().should('eq', Cypress.config().baseUrl + '/reviews/1') }) }) @@ -58,7 +58,7 @@ describe('URL access', () => { context('if no stages are cleared yet', () => { it('gets redirected home', () => { cy.visit('/thank-you-for-playing') - cy.wait(500) + cy.wait(750) cy.url().should('eq', Cypress.config().baseUrl + '/') }) }) @@ -67,7 +67,7 @@ describe('URL access', () => { it('gets redirected home', () => { cy.setLocalStorage('gorogoropanda.com/clearedStage', 'ttw'); cy.visit('/thank-you-for-playing') - cy.wait(500) + cy.wait(750) cy.url().should('eq', Cypress.config().baseUrl + '/') }) }) @@ -77,7 +77,7 @@ describe('URL access', () => { cy.setLocalStorage('gorogoropanda.com/clearedStage', 'ttw'); cy.setLocalStorage('gorogoropanda.com/clearedReview', 'gjj'); cy.visit('/thank-you-for-playing') - cy.wait(500) + cy.wait(750) cy.url().should('eq', Cypress.config().baseUrl + '/thank-you-for-playing') }) })