Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

AnatoliiZinevych
Copy link

No description provided.

it('', () => {

it('should allow to search for the book', () => {
cy.login();

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree

Copy link

@Zakhar27 Zakhar27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GJ

Copy link

@djtyrf312 djtyrf312 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check the comments

it('', () => {

it('should allow to search for the book', () => {
cy.login();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree

it('', () => {

it('should allow to search for the book', () => {
cy.login();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cy.login();
cy.login(user.username, user.password);

cy.login();
cy.visit('/books');
cy.get('#searchBox')
.type('Speaking JavaScript');

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

@@ -23,3 +23,20 @@
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
import './commands';

Cypress.Commands.add('login', () => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Cypress.Commands.add('login', () => {
Cypress.Commands.add('login', (username, password) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not fixed

Comment on lines 33 to 34
userName: 'Flood',
password: 'qwert!Q12345'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
userName: 'Flood',
password: 'qwert!Q12345'
userName: username,
password: password,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not fixed

Copy link

@Huskov-Anton Huskov-Anton left a 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

@@ -23,3 +23,20 @@
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
import './commands';

Cypress.Commands.add('login', () => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not fixed

Comment on lines 33 to 34
userName: 'Flood',
password: 'qwert!Q12345'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not fixed

Copy link

@djtyrf312 djtyrf312 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check the comments

Comment on lines 7 to 8
textForSearching: 'Speaking JavaScript',
title: 'Speaking JavaScript',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants