extend from global settings and modify cypress config

This commit is contained in:
Annie Huang committed 2024-02-27 11:41:37 +08:00
1 parent 004d232a84
commit 9e108e397b
3 files changed
+21 -17

No files matched your search

+2 -2
View File
@@ -11,7 +11,7 @@ declare global {
PrepareForGame(): Chainable<void>
InitTerminal(): Chainable<void>
typeInCommand(command: string): Chainable<string>
getQuestInfo(id: string): Chainable<JQuery<HTMLElement>>
getQuestInfo(id: string): Chainable<JQuery<HTMLParagraphElement>>
checkHint(index: number, total: number): Chainable<number> // 修改類型
checkTaskInit(): Chainable<void>
waitUntilActive(last?: boolean): Chainable<void> // 注意小寫boolean,並且變量名應該是小寫
@@ -41,7 +41,7 @@ Cypress.Commands.add('LoginWithPassword', (username, password) => {
Cypress.Commands.add('PrepareForGame', () => {
cy.visit('/')
// make sure the login page is loaded
cy.url().should('satisfy', (elements) => {
cy.url().should('satisfy', (elements: string) => {
const text = elements
return text.includes('login') || text.includes('register')
})