diff --git a/quests/helloworld/answer.sh b/quests/helloworld/answer.sh new file mode 100644 index 0000000..73d9176 --- /dev/null +++ b/quests/helloworld/answer.sh @@ -0,0 +1,4 @@ +echo help{enter} +ls {enter} +cat forgotten_scroll.txt{enter} +echo Hello World!{enter} \ No newline at end of file diff --git a/tests/cypress/e2e/helloworld.cy.js b/tests/cypress/e2e/helloworld.cy.js index cbdd011..493a8ad 100644 --- a/tests/cypress/e2e/helloworld.cy.js +++ b/tests/cypress/e2e/helloworld.cy.js @@ -142,6 +142,8 @@ describe('example helloworld app', () => { cy.checkHint(1, 1) cy.getQuestInfo('✓ 輸入 `echo help` 來朗誦咒語').should('be.visible') cy.getQuestInfo('搜索卷軸').should('be.visible') + cy.getQuestInfo('✓ 輸入 `echo help` 來朗誦咒語').should('be.visible') + cy.getQuestInfo('搜索卷軸').should('be.visible') // Stage2 cy.log('Stage2') cy.typeInCommand(answerarr[1]) @@ -154,10 +156,13 @@ describe('example helloworld app', () => { cy.get('#Lbutton').should('be.visible').and('be.enabled') cy.get('#Rbutton').should('be.visible').and('be.disabled') cy.checkHint(2, 2) + cy.checkHint(2, 2) cy.get('#Lbutton').click() cy.get('#Rbutton').should('be.enabled') cy.getQuestInfo('✓ 搜索卷軸').should('be.visible') cy.getQuestInfo('查看卷軸').should('be.visible') + cy.getQuestInfo('✓ 搜索卷軸').should('be.visible') + cy.getQuestInfo('查看卷軸').should('be.visible') // Stage3 cy.log('Stage3') cy.typeInCommand(answerarr[2]) diff --git a/tests/cypress/support/commands.js b/tests/cypress/support/commands.js index 2e58468..f6d6746 100644 --- a/tests/cypress/support/commands.js +++ b/tests/cypress/support/commands.js @@ -20,6 +20,10 @@ Cypress.Commands.add('PrepareForGame', () => { 'contain', 'commander:~ $' ) + cy.get('@Terminaltextbox', { timeout: 150000 }).should( + 'contain', + 'commander:~ $' + ) }) Cypress.Commands.add('typeInCommand', (command) => { cy.get('.xterm-screen', { timeout: 150000 }).type(command) diff --git a/yarn.lock b/yarn.lock index 18ab147..221eb7e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -314,9 +314,7 @@ resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.15.tgz#09576efc3830f0430f4548ef971dde1350ef2f38" integrity sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w== dependencies: - "@babel/code-frame" "^7.22.13" - "@babel/parser" "^7.22.15" - "@babel/types" "^7.22.15" + regenerator-runtime "^0.14.0" "@babel/template@^7.22.5", "@babel/template@^7.3.3": version "7.22.5"