reduce timeout

This commit is contained in:
Annie Huang committed 2023-12-10 00:08:45 +08:00
1 parent 581e75ee57
commit 175db7b8bc
1 file changed
+6 -6
+6 -6
View File
@@ -24,7 +24,7 @@ Cypress.Commands.add('PrepareForGame', () => {
cy.url().should('include', '/game/get-started') cy.url().should('include', '/game/get-started')
// check task first so the terminal has better possibility loaded // check task first so the terminal has better possibility loaded
cy.checkTaskInit() cy.checkTaskInit()
cy.get('.xterm-screen', { timeout: 100000 }) cy.get('.xterm-screen', { timeout: 10000 })
.as('Terminaltextbox') .as('Terminaltextbox')
.should('be.visible') .should('be.visible')
cy.CheckTextElement('#reset', '重來', 'Reset').click() cy.CheckTextElement('#reset', '重來', 'Reset').click()
@@ -32,21 +32,21 @@ Cypress.Commands.add('PrepareForGame', () => {
cy.InitTerminal() cy.InitTerminal()
}) })
Cypress.Commands.add('InitTerminal', () => { Cypress.Commands.add('InitTerminal', () => {
cy.get('@Terminaltextbox', { timeout: 150000 }).should( cy.get('@Terminaltextbox', { timeout: 15000 }).should(
'contain', 'contain',
'commander:~ $' 'commander:~ $'
) )
cy.log('Check terminal init done') cy.log('Check terminal init done')
}) })
Cypress.Commands.add('typeInCommand', (command) => { Cypress.Commands.add('typeInCommand', (command) => {
cy.get('.xterm-screen', { timeout: 150000 }).type(command) cy.get('.xterm-screen', { timeout: 15000 }).type(command)
}) })
Cypress.Commands.add('getQuestInfo', (id) => { Cypress.Commands.add('getQuestInfo', (id) => {
return cy return cy
.get('#quest') .get('#quest')
.find('li') .find('li')
.find('p') .find('p')
.contains(`${id}`, { timeout: 100000 }) .contains(`${id}`, { timeout: 10000 })
}) })
Cypress.Commands.add('checkHint', (index, total) => { Cypress.Commands.add('checkHint', (index, total) => {
cy.get('#hint') cy.get('#hint')
@@ -58,7 +58,7 @@ Cypress.Commands.add('checkTaskInit', () => {
cy.get('#tasks').next().children().should('be.visible') cy.get('#tasks').next().children().should('be.visible')
}) })
Cypress.Commands.add('waitUntilActive', (last = false) => { Cypress.Commands.add('waitUntilActive', (last = false) => {
cy.get('input[id="currentStatus"]', { timeout: 1000000 }) cy.get('input[id="currentStatus"]', { timeout: 10000 })
.invoke('val') .invoke('val')
.then((value) => { .then((value) => {
if (value === 'active') { if (value === 'active') {
@@ -77,7 +77,7 @@ Cypress.Commands.add('waitUntilActive', (last = false) => {
}) })
}) })
Cypress.Commands.add('checkPending', () => { Cypress.Commands.add('checkPending', () => {
cy.get('input[id="currentStatus"]', { timeout: 1000000 }).should( cy.get('input[id="currentStatus"]', { timeout: 10000 }).should(
'have.value', 'have.value',
'pending' 'pending'
) )