From a351eef8986097c8f1b61cbfe57046f2e4d2894f Mon Sep 17 00:00:00 2001 From: Annie Huang Date: Sun, 29 Oct 2023 01:48:24 +0800 Subject: [PATCH] fix usage --- tests/cypress/e2e/helloworld.cy.js | 4 ++-- tests/cypress/support/commands.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/cypress/e2e/helloworld.cy.js b/tests/cypress/e2e/helloworld.cy.js index 2dc015b..77ccd0f 100644 --- a/tests/cypress/e2e/helloworld.cy.js +++ b/tests/cypress/e2e/helloworld.cy.js @@ -23,7 +23,7 @@ export function checkHint(index, total) { .contains(`${index}/${total}`) .should('be.visible') } -const finishSign = 'commander:~ ' +const finishSign = 'commander:~ $' const continueSign = '↵' const storyStart = 'Unix Spirit: ' @@ -98,7 +98,7 @@ describe('example helloworld app', () => { 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').should('contain', finishSign) }) it('Check Header', () => { cy.get('#quest').should('be.visible') diff --git a/tests/cypress/support/commands.js b/tests/cypress/support/commands.js index 6cffa80..65c2638 100644 --- a/tests/cypress/support/commands.js +++ b/tests/cypress/support/commands.js @@ -36,7 +36,7 @@ Cypress.Commands.add('typeInCommand', (command) => { cy.get('.xterm-screen').type(command) }) Cypress.Commands.add('getQuestInfo', (id) => { - return cy.get('#quest').get('p.text-text').contains(`${id}`) + return cy.get('#quest').find('p.text-text').contains(`${id}`) }) Cypress.Commands.add('getTaskCheckbox', (id) => { return cy.getQuestInfo(id).findByRole('checkbox')