fix: command update

This commit is contained in:
Annie Huang committed 2023-10-30 15:00:30 +08:00
1 parent 2089765c53
commit ee841b42e7
3 files changed
+14 -6

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
echo Hello World!{enter}
ls {enter}
mkdir jail{enter}
ls {enter}
cd jail{enter}
cd ..{enter}
rmdir jail{enter}
ls {enter}
cat forgotten_scroll.txt{enter}
echo Unix,rise and guide me!{enter}
-2
View File
@@ -23,7 +23,5 @@ module.exports = defineConfig({
// Cannot read github client id
// github_client_id: process.env.GITHUB_CLIENT_ID,
// github_client_secret: process.env.GITHUB_CLIENT_SECRET,
username: 'alex',
password: '123456',
},
})
+4 -4
View File
@@ -25,10 +25,10 @@
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
import '@testing-library/cypress/add-commands'
Cypress.Commands.add('LoginWithPassword', () => {
cy.clearAllCookies()
Cypress.Commands.add('LoginWithPassword', (username, password) => {
cy.clearAllCookies({ domain: null })
cy.get('a.text-text-primary').should('contain', 'Log in').click()
cy.get('#username').type(Cypress.env('username'))
cy.get('#password').type(Cypress.env('password'))
cy.get('#username').type(username)
cy.get('#password').type(password)
cy.findByRole('button', { name: 'Log in' }).click()
})