mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-08 11:30:12 +08:00
Update tests:
- Add public command to press enter until story end - Add public command to check status pending
This commit is contained in:
1 parent
5d7c922fa6
commit
c86163fd10
2 files changed
+36
-18
No files matched your search
@@ -27,7 +27,8 @@ Cypress.Commands.add('typeInCommand', (command) => {
|
||||
Cypress.Commands.add('getQuestInfo', (id) => {
|
||||
return cy
|
||||
.get('#quest')
|
||||
.find('p.text-text')
|
||||
.find('li')
|
||||
.find('p')
|
||||
.contains(`${id}`, { timeout: 100000 })
|
||||
})
|
||||
Cypress.Commands.add('checkHint', (index, total) => {
|
||||
@@ -36,3 +37,21 @@ Cypress.Commands.add('checkHint', (index, total) => {
|
||||
.contains(`${index}/${total}`)
|
||||
.should('be.visible')
|
||||
})
|
||||
Cypress.Commands.add('waitUntilActive', () => {
|
||||
cy.get('input[id="currentStatus"]', { timeout: 1000000 })
|
||||
.invoke('val')
|
||||
.then((value) => {
|
||||
if (value === 'active' || value === 'finished') {
|
||||
cy.log('story ends')
|
||||
return
|
||||
}
|
||||
cy.typeInCommand('{enter}')
|
||||
cy.waitUntilActive()
|
||||
})
|
||||
})
|
||||
Cypress.Commands.add('checkPending', () => {
|
||||
cy.get('input[id="currentStatus"]', { timeout: 1000000 }).should(
|
||||
'have.value',
|
||||
'pending'
|
||||
)
|
||||
})
|
||||
Reference in new issue
Block a user