-
Notifications
You must be signed in to change notification settings - Fork 363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added two tests #332
base: master
Are you sure you want to change the base?
added two tests #332
Conversation
cypress/e2e/bookStore.cy.js
Outdated
it('', () => { | ||
|
||
it('should allow to search for the book', () => { | ||
cy.login(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could also add user object field's to request body. And then input user object as a parameter when you call this command to fully use user object) Well done anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GJ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check the comments
cypress/e2e/bookStore.cy.js
Outdated
it('', () => { | ||
|
||
it('should allow to search for the book', () => { | ||
cy.login(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree
cypress/e2e/bookStore.cy.js
Outdated
it('', () => { | ||
|
||
it('should allow to search for the book', () => { | ||
cy.login(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cy.login(); | |
cy.login(user.username, user.password); |
cypress/e2e/bookStore.cy.js
Outdated
cy.login(); | ||
cy.visit('/books'); | ||
cy.get('#searchBox') | ||
.type('Speaking JavaScript'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
create a const for 'Speaking JavaScript' string and reuse it
cypress/support/commands.js
Outdated
@@ -23,3 +23,20 @@ | |||
// | |||
// -- This will overwrite an existing command -- | |||
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) | |||
import './commands'; | |||
|
|||
Cypress.Commands.add('login', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cypress.Commands.add('login', () => { | |
Cypress.Commands.add('login', (username, password) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not fixed
cypress/support/commands.js
Outdated
userName: 'Flood', | ||
password: 'qwert!Q12345' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
userName: 'Flood', | |
password: 'qwert!Q12345' | |
userName: username, | |
password: password, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
little changes are required
cypress/support/commands.js
Outdated
@@ -23,3 +23,20 @@ | |||
// | |||
// -- This will overwrite an existing command -- | |||
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) | |||
import './commands'; | |||
|
|||
Cypress.Commands.add('login', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not fixed
cypress/support/commands.js
Outdated
userName: 'Flood', | ||
password: 'qwert!Q12345' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check the comments
cypress/e2e/bookStore.cy.js
Outdated
textForSearching: 'Speaking JavaScript', | ||
title: 'Speaking JavaScript', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
textForSearching: 'Speaking JavaScript', | |
title: 'Speaking JavaScript', | |
textForSearching: 'Speaking JavaScript', | |
title: 'Speaking JavaScript', |
why do you need two the same variables but with the different name? left 1 variable and reuse it
No description provided.