mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-08 11:30:12 +08:00
fixed type error
This commit is contained in:
1 parent
2cb82fdcdc
commit
9bac360498
2 files changed
+16
-20
No files matched your search
@@ -95,20 +95,18 @@ describe('example helloworld app', () => {
|
|||||||
cy.CheckTextElement('#tasks', '任務', 'Tasks:')
|
cy.CheckTextElement('#tasks', '任務', 'Tasks:')
|
||||||
})
|
})
|
||||||
it('Check Terminal', () => {
|
it('Check Terminal', () => {
|
||||||
cy.get('#terminal', { timeout: 20000 }).within(($terminal) => {
|
// cy.get('#terminal', { timeout: 20000 }).within(($terminal) => {
|
||||||
cy.get($terminal).should('be.visible')
|
// cy.get($terminal).should('be.visible')
|
||||||
cy.get('svg[data-icon="terminal"]').should('be.visible')
|
cy.get('#terminal', { timeout: 20000 }).should('be.visible')
|
||||||
cy.CheckTextElement('#Terminal', '終端機', 'Terminal')
|
cy.get('svg[data-icon="terminal"]').should('be.visible')
|
||||||
cy.get('@Terminaltextbox')
|
cy.CheckTextElement('#Terminal', '終端機', 'Terminal')
|
||||||
.should('be.visible')
|
cy.get('@Terminaltextbox')
|
||||||
.and('contain', 'commander:~ $')
|
.should('be.visible')
|
||||||
})
|
.and('contain', 'commander:~ $')
|
||||||
})
|
})
|
||||||
it('Check Hint Part', () => {
|
it('Check Hint Part', () => {
|
||||||
cy.get('#hint', { timeout: 20000 }).within(($hint) => {
|
cy.get('#hint', { timeout: 20000 }).should('be.visible')
|
||||||
cy.get($hint).should('be.visible')
|
cy.get('svg[data-icon="lightbulb"]').should('be.visible')
|
||||||
cy.get('svg[data-icon="lightbulb"]').should('be.visible')
|
|
||||||
})
|
|
||||||
cy.CheckTextElement('#hint', '提示', 'Hint')
|
cy.CheckTextElement('#hint', '提示', 'Hint')
|
||||||
})
|
})
|
||||||
it('Check File TreeChart', () => {
|
it('Check File TreeChart', () => {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ declare global {
|
|||||||
PrepareForGame(): Chainable<void>
|
PrepareForGame(): Chainable<void>
|
||||||
InitTerminal(): Chainable<void>
|
InitTerminal(): Chainable<void>
|
||||||
typeInCommand(command: string): Chainable<void>
|
typeInCommand(command: string): Chainable<void>
|
||||||
getQuestInfo(id: string): Chainable<string>
|
getQuestInfo(id: string): Chainable<JQuery<HTMLElement>>
|
||||||
checkHint(index: number, total: number): Chainable<void> // 修改類型
|
checkHint(index: number, total: number): Chainable<void> // 修改類型
|
||||||
checkTaskInit(): Chainable<void>
|
checkTaskInit(): Chainable<void>
|
||||||
waitUntilActive(last?: boolean): Chainable<void> // 注意小寫boolean,並且變量名應該是小寫
|
waitUntilActive(last?: boolean): Chainable<void> // 注意小寫boolean,並且變量名應該是小寫
|
||||||
@@ -136,13 +136,11 @@ Cypress.Commands.add('CompleteStageWithCommands', (stagename) => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
Cypress.Commands.add('CheckTextElement', (id, chText, enText) => {
|
Cypress.Commands.add('CheckTextElement', (id, chText, enText) => {
|
||||||
cy.get(id, { timeout: 50000 }).within(($element) => {
|
if (Cypress.env('isCHVersion')) {
|
||||||
if (Cypress.env('isCHVersion')) {
|
cy.get(id, { timeout: 50000 }).should('contain', chText).and('be.visible')
|
||||||
cy.get($element).should('contain', chText).and('be.visible')
|
} else {
|
||||||
} else {
|
cy.get(id, { timeout: 50000 }).should('contain', enText).and('be.visible')
|
||||||
cy.get($element).should('contain', enText).and('be.visible')
|
}
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
Cypress.Commands.add('CheckPlaceholder', (id, chText, enText) => {
|
Cypress.Commands.add('CheckPlaceholder', (id, chText, enText) => {
|
||||||
cy.get(id)
|
cy.get(id)
|
||||||
|
|||||||
Reference in new issue
Block a user