mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-08 11:30:12 +08:00
update tests
- having bug testing blocked by limited reset time - not yet check the playing part is fine
This commit is contained in:
1 parent
98ba300227
commit
c510e4a541
4 files changed
+51
-93
No files matched your search
@@ -16,20 +16,23 @@ Cypress.Commands.add('PrepareForGame', () => {
|
||||
cy.get('.xterm-screen').as('Terminaltextbox').should('be.visible')
|
||||
cy.findByRole('button', { name: 'Reset' }).click()
|
||||
cy.typeInCommand('clear{enter}')
|
||||
cy.get('@Terminaltextbox').should('contain', 'commander:~ $')
|
||||
cy.get('@Terminaltextbox', { timeout: 150000 }).should(
|
||||
'contain',
|
||||
'commander:~ $'
|
||||
)
|
||||
})
|
||||
Cypress.Commands.add('typeInCommand', (command) => {
|
||||
cy.get('.xterm-screen', { timeout: 150000 }).type(command)
|
||||
})
|
||||
Cypress.Commands.add('getQuestInfo', (id) => {
|
||||
return cy.get('#quest').find('p.text-text').contains(`${id}`)
|
||||
})
|
||||
Cypress.Commands.add('getTaskCheckbox', (id) => {
|
||||
return cy.getQuestInfo(id).findByRole('checkbox')
|
||||
return cy
|
||||
.get('#quest')
|
||||
.find('p.text-text')
|
||||
.contains(`${id}`, { timeout: 100000 })
|
||||
})
|
||||
Cypress.Commands.add('checkHint', (index, total) => {
|
||||
cy.get('#hint')
|
||||
.find('.flex-wrap')
|
||||
.find('.justify-end')
|
||||
.contains(`${index}/${total}`)
|
||||
.should('be.visible')
|
||||
})
|
||||
Reference in new issue
Block a user