update tests

- having bug testing blocked by limited reset time
- not yet check the playing part is fine

(cherry picked from commit c510e4a541)
This commit is contained in:
Annie Huang committed 2023-11-13 22:20:10 +08:00
1 parent 837712b742
commit 610eb3d2b7
4 files changed
+14 -3

No files matched your search

+4
View File
@@ -0,0 +1,4 @@
echo help{enter}
ls {enter}
cat forgotten_scroll.txt{enter}
echo Hello World!{enter}
+5
View File
@@ -142,6 +142,8 @@ describe('example helloworld app', () => {
cy.checkHint(1, 1) cy.checkHint(1, 1)
cy.getQuestInfo('✓ 輸入 `echo help` 來朗誦咒語').should('be.visible') cy.getQuestInfo('✓ 輸入 `echo help` 來朗誦咒語').should('be.visible')
cy.getQuestInfo('搜索卷軸').should('be.visible') cy.getQuestInfo('搜索卷軸').should('be.visible')
cy.getQuestInfo('✓ 輸入 `echo help` 來朗誦咒語').should('be.visible')
cy.getQuestInfo('搜索卷軸').should('be.visible')
// Stage2 // Stage2
cy.log('Stage2') cy.log('Stage2')
cy.typeInCommand(answerarr[1]) cy.typeInCommand(answerarr[1])
@@ -154,10 +156,13 @@ describe('example helloworld app', () => {
cy.get('#Lbutton').should('be.visible').and('be.enabled') cy.get('#Lbutton').should('be.visible').and('be.enabled')
cy.get('#Rbutton').should('be.visible').and('be.disabled') cy.get('#Rbutton').should('be.visible').and('be.disabled')
cy.checkHint(2, 2) cy.checkHint(2, 2)
cy.checkHint(2, 2)
cy.get('#Lbutton').click() cy.get('#Lbutton').click()
cy.get('#Rbutton').should('be.enabled') 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')
cy.getQuestInfo('✓ 搜索卷軸').should('be.visible')
cy.getQuestInfo('查看卷軸').should('be.visible')
// Stage3 // Stage3
cy.log('Stage3') cy.log('Stage3')
cy.typeInCommand(answerarr[2]) cy.typeInCommand(answerarr[2])
+4
View File
@@ -20,6 +20,10 @@ Cypress.Commands.add('PrepareForGame', () => {
'contain', 'contain',
'commander:~ $' 'commander:~ $'
) )
cy.get('@Terminaltextbox', { timeout: 150000 }).should(
'contain',
'commander:~ $'
)
}) })
Cypress.Commands.add('typeInCommand', (command) => { Cypress.Commands.add('typeInCommand', (command) => {
cy.get('.xterm-screen', { timeout: 150000 }).type(command) cy.get('.xterm-screen', { timeout: 150000 }).type(command)
+1 -3
View File
@@ -314,9 +314,7 @@
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.15.tgz#09576efc3830f0430f4548ef971dde1350ef2f38" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.15.tgz#09576efc3830f0430f4548ef971dde1350ef2f38"
integrity sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w== integrity sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==
dependencies: dependencies:
"@babel/code-frame" "^7.22.13" regenerator-runtime "^0.14.0"
"@babel/parser" "^7.22.15"
"@babel/types" "^7.22.15"
"@babel/template@^7.22.5", "@babel/template@^7.3.3": "@babel/template@^7.22.5", "@babel/template@^7.3.3":
version "7.22.5" version "7.22.5"