mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-08 03:20:12 +08:00
fix: e2e broken caused by website modification
This commit is contained in:
1 parent
580d5fc3f8
commit
36e6bc10d3
4 files changed
+10
-10
No files matched your search
@@ -8,7 +8,7 @@ declare global {
|
||||
namespace Cypress {
|
||||
interface Chainable {
|
||||
LoginWithPassword(username: string, password: string): Chainable<string>
|
||||
PrepareForGame(): Chainable<void>
|
||||
PrepareForGame(questId: string): Chainable<string>
|
||||
InitTerminal(): Chainable<void>
|
||||
typeInCommand(command: string): Chainable<string>
|
||||
getQuestInfo(id: string): Chainable<JQuery<HTMLParagraphElement>>
|
||||
@@ -38,8 +38,8 @@ Cypress.Commands.add('LoginWithPassword', (username, password) => {
|
||||
cy.get('#password').type(password)
|
||||
cy.get('#LogInOrSignUp').click()
|
||||
})
|
||||
Cypress.Commands.add('PrepareForGame', (questId) => {
|
||||
cy.visit('/')
|
||||
Cypress.Commands.add('PrepareForGame', (questId: string) => {
|
||||
cy.visit('/login')
|
||||
// make sure the login page is loaded
|
||||
cy.url().should('satisfy', (elements: string) => {
|
||||
const text = elements
|
||||
@@ -143,9 +143,9 @@ Cypress.Commands.add('CompleteStageWithCommands', (stagename) => {
|
||||
})
|
||||
Cypress.Commands.add('CheckTextElement', (id, chText, enText) => {
|
||||
if (Cypress.env('isCHVersion')) {
|
||||
cy.get(id, { timeout: 50000 }).should('contain', chText).and('be.visible')
|
||||
cy.get(id, { timeout: 7000 }).should('contain', chText).and('be.visible')
|
||||
} else {
|
||||
cy.get(id, { timeout: 50000 }).should('contain', enText).and('be.visible')
|
||||
cy.get(id, { timeout: 7000 }).should('contain', enText).and('be.visible')
|
||||
}
|
||||
})
|
||||
Cypress.Commands.add('CheckPlaceholder', (id, chText, enText) => {
|
||||
|
||||
Reference in new issue
Block a user