mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-05 19:20:12 +08:00
Merge branch 'main' into quest
This commit is contained in:
18 files changed
+315
-29
No files matched your search
@@ -79,7 +79,7 @@ describe('example helloworld app', () => {
|
||||
cy.PrepareForGame()
|
||||
})
|
||||
it('Check Header', () => {
|
||||
cy.get('#HeaderText').should('contain', title).and('be.visible')
|
||||
cy.get('#HeaderText').should('contain', 'Linux Odyssey').and('be.visible')
|
||||
cy.findByRole('link', { name: 'Bug Report' }).should('be.visible')
|
||||
cy.findByRole('button', { name: 'Sign Out' }).should('be.visible')
|
||||
})
|
||||
@@ -123,8 +123,8 @@ describe('example helloworld app', () => {
|
||||
it('Typing in Terminal', () => {
|
||||
cy.typeInCommand('12345{enter}')
|
||||
cy.get('@Terminaltextbox')
|
||||
.should('contain', 'zsh: command not found: 12345')
|
||||
.and('contain', '12345')
|
||||
.should('contain', '12345')
|
||||
.and('contain', 'zsh: command not found: 12345', { timeout: 50000 })
|
||||
})
|
||||
it('Complete the Game(relating UI)', () => {
|
||||
// Stage1
|
||||
|
||||
@@ -9,12 +9,19 @@ Cypress.Commands.add('LoginWithPassword', (username, password) => {
|
||||
})
|
||||
Cypress.Commands.add('PrepareForGame', () => {
|
||||
cy.visit('/')
|
||||
// make sure the login page is loaded
|
||||
cy.url().should('satisfy', (elements) => {
|
||||
const text = elements
|
||||
return text.includes('login') || text.includes('register')
|
||||
})
|
||||
cy.LoginWithPassword(
|
||||
Cypress.env('defaultAccount'),
|
||||
Cypress.env('defaultPassword')
|
||||
)
|
||||
// make sure the map page is loaded
|
||||
cy.url().should('include', '/map')
|
||||
cy.visit('/game/get-started')
|
||||
cy.url().should('include', '/game/get-started')
|
||||
cy.get('.xterm-screen', { timeout: 10000 })
|
||||
.as('Terminaltextbox')
|
||||
.should('be.visible')
|
||||
@@ -24,10 +31,6 @@ Cypress.Commands.add('PrepareForGame', () => {
|
||||
'contain',
|
||||
'commander:~ $'
|
||||
)
|
||||
cy.get('@Terminaltextbox', { timeout: 150000 }).should(
|
||||
'contain',
|
||||
'commander:~ $'
|
||||
)
|
||||
})
|
||||
Cypress.Commands.add('typeInCommand', (command) => {
|
||||
cy.get('.xterm-screen', { timeout: 150000 }).type(command)
|
||||
|
||||
Reference in new issue
Block a user