mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-05 19: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
@@ -25,6 +25,7 @@ const toggleMenu = () => {
|
|||||||
<img src="../../img/icon_totem.svg" class="h-8 justify-self-start" />
|
<img src="../../img/icon_totem.svg" class="h-8 justify-self-start" />
|
||||||
<RouterLink
|
<RouterLink
|
||||||
to="/"
|
to="/"
|
||||||
|
id="GameTitle"
|
||||||
class="text-text-primary inline-block font-bold whitespace-nowrap pt-1 transition ease-in-out hover:scale-110 duration-300"
|
class="text-text-primary inline-block font-bold whitespace-nowrap pt-1 transition ease-in-out hover:scale-110 duration-300"
|
||||||
style="font-size: 2vh"
|
style="font-size: 2vh"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -8,5 +8,4 @@ mv world.txt wow.txt
|
|||||||
ls
|
ls
|
||||||
mv notes docs
|
mv notes docs
|
||||||
ls
|
ls
|
||||||
echo hint
|
|
||||||
mv docs/hello.txt hi.txt
|
mv docs/hello.txt hi.txt
|
||||||
@@ -5,7 +5,7 @@ export default function checkLoginUI() {
|
|||||||
describe('example helloworld app', () => {
|
describe('example helloworld app', () => {
|
||||||
describe('Login tests', () => {
|
describe('Login tests', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.visit('/')
|
cy.visit('/register')
|
||||||
})
|
})
|
||||||
it('Check Login Page Elements-Register', () => {
|
it('Check Login Page Elements-Register', () => {
|
||||||
checkLoginUI()
|
checkLoginUI()
|
||||||
@@ -83,11 +83,11 @@ describe('example helloworld app', () => {
|
|||||||
cy.get('#UsernameText')
|
cy.get('#UsernameText')
|
||||||
.should('contain', Cypress.env('defaultAccount'))
|
.should('contain', Cypress.env('defaultAccount'))
|
||||||
.and('be.visible')
|
.and('be.visible')
|
||||||
|
cy.findByRole('link', { name: 'Survey' }).should('be.visible')
|
||||||
|
cy.findByRole('link', { name: 'LeaderBoard' }).should('be.visible')
|
||||||
|
cy.findByRole('link', { name: 'Map' }).should('be.visible')
|
||||||
cy.findByRole('link', { name: 'Bug Report' }).should('be.visible')
|
cy.findByRole('link', { name: 'Bug Report' }).should('be.visible')
|
||||||
cy.findByRole('button', { name: 'Sign Out' }).should('be.visible')
|
cy.findByRole('button', { name: 'Sign Out' }).should('be.visible')
|
||||||
cy.findByRole('button', { name: 'Map' }).should('be.visible')
|
|
||||||
cy.findByRole('button', { name: 'LeaderBoard' }).should('be.visible')
|
|
||||||
cy.findByRole('link', { name: 'Survey' }).should('be.visible')
|
|
||||||
})
|
})
|
||||||
it('Check QuestInfo', () => {
|
it('Check QuestInfo', () => {
|
||||||
cy.get('#topic').should('contain', title)
|
cy.get('#topic').should('contain', title)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ declare global {
|
|||||||
namespace Cypress {
|
namespace Cypress {
|
||||||
interface Chainable {
|
interface Chainable {
|
||||||
LoginWithPassword(username: string, password: string): Chainable<string>
|
LoginWithPassword(username: string, password: string): Chainable<string>
|
||||||
PrepareForGame(): Chainable<void>
|
PrepareForGame(questId: string): Chainable<string>
|
||||||
InitTerminal(): Chainable<void>
|
InitTerminal(): Chainable<void>
|
||||||
typeInCommand(command: string): Chainable<string>
|
typeInCommand(command: string): Chainable<string>
|
||||||
getQuestInfo(id: string): Chainable<JQuery<HTMLParagraphElement>>
|
getQuestInfo(id: string): Chainable<JQuery<HTMLParagraphElement>>
|
||||||
@@ -38,8 +38,8 @@ Cypress.Commands.add('LoginWithPassword', (username, password) => {
|
|||||||
cy.get('#password').type(password)
|
cy.get('#password').type(password)
|
||||||
cy.get('#LogInOrSignUp').click()
|
cy.get('#LogInOrSignUp').click()
|
||||||
})
|
})
|
||||||
Cypress.Commands.add('PrepareForGame', (questId) => {
|
Cypress.Commands.add('PrepareForGame', (questId: string) => {
|
||||||
cy.visit('/')
|
cy.visit('/login')
|
||||||
// make sure the login page is loaded
|
// make sure the login page is loaded
|
||||||
cy.url().should('satisfy', (elements: string) => {
|
cy.url().should('satisfy', (elements: string) => {
|
||||||
const text = elements
|
const text = elements
|
||||||
@@ -143,9 +143,9 @@ Cypress.Commands.add('CompleteStageWithCommands', (stagename) => {
|
|||||||
})
|
})
|
||||||
Cypress.Commands.add('CheckTextElement', (id, chText, enText) => {
|
Cypress.Commands.add('CheckTextElement', (id, chText, enText) => {
|
||||||
if (Cypress.env('isCHVersion')) {
|
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 {
|
} 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) => {
|
Cypress.Commands.add('CheckPlaceholder', (id, chText, enText) => {
|
||||||
|
|||||||
Reference in new issue
Block a user