Skip to content

Conversation

@Cronus1007
Copy link
Member

Fixes

Fixes #302 by @obulat

Description

Technical details

Tests

Screenshots

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the default branch of the repository (main or master).
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no
    visible errors.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@Cronus1007 Cronus1007 requested a review from a team as a code owner January 19, 2021 14:17
@Cronus1007 Cronus1007 requested review from akmadian and removed request for a team January 19, 2021 14:17
@Cronus1007 Cronus1007 changed the title Stepper created Cypress e2e test for Stepper Jan 19, 2021
Copy link
Contributor

@obulat obulat left a comment

Choose a reason for hiding this comment

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

Getting there!
I have left comments inline. Another thing : could you change the step selectors from step-0 etc to 'FS'/'BY' etc ? This will make the tests easier to read, as we will see what kind of step we are interacting with.

cy.get('select').select('CC0 1.0')
cy.get('.recommended-card').should('be.visible').contains('CC0 1.0 Universal')
cy.get('.next-button').click()
cy.get('.v-checkbox:nth-child(1) > input').check()
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a check for and the total number of steps should be 4.

Copy link
Member Author

Choose a reason for hiding this comment

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

@obulat I have a question that whether total number of steps are required for the test which you have mentioned or for each and every test in the test file.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's for this test only.

.check()
cy.get('.next-button').click()
cy.get('.step-1')
.find('[value="yes"]')
Copy link
Contributor

Choose a reason for hiding this comment

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

Move the recommended-card check from line 83 here.

cy.get('.step-1')
.find('[value="yes"]')
.check()
cy.get('.next-button').click()
Copy link
Contributor

Choose a reason for hiding this comment

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

Move the .recommended-card check from line 107 here.

cy.get('.next-button').click()
cy.get('.step-1')
.find('[value="yes"]')
.check()
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add the check for .recommended-card value here?
Don't remove the check from line 186.

describe('Checks whether the user can click on Start Again Button and application gets a hot reload', () => {
it('Clicks on Start Again Buttton', () => {
cy.get('.restart-button').click()
cy.get('.step-1').should('have.class','inactive')
Copy link
Contributor

Choose a reason for hiding this comment

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

Please, add the check for .recommended-card and .license-use-card. They shouldn't be visible.

cy.get('.recommended-card').should('be.visible').contains('CC BY-ND 4.0')
cy.get('.license-use-card').should('be.visible').contains('CC BY-ND 4.0')
cy.get('.next-button').click()
cy.get('.license-use-card').scrollIntoView()
Copy link
Contributor

Choose a reason for hiding this comment

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

You do not need to scroll an element into view. In fact, when you click the 'Done' button, it should scroll automatically, and we need to check if it does.
Actually, it is better to test it on a mobile viewport. Could you set up this test with the mobile viewport?

Copy link
Member Author

Choose a reason for hiding this comment

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

@obulat You want me to convert viewport or this particular test or for the complete test file.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I would like this particular test to have a different viewport.

Copy link
Member Author

Choose a reason for hiding this comment

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

Shall I give iphone 10 viewport. Will that be okay or any other .

Copy link
Contributor

Choose a reason for hiding this comment

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

Any viewport width of under 768px will do, as that's the breakpoint when the two-column layout becomes a one-column layout.

@Cronus1007 Cronus1007 requested a review from obulat January 20, 2021 13:21
@Cronus1007
Copy link
Member Author

Cronus1007 commented Jan 20, 2021

@obulat Plzzzz have a look at this comment.At the end the repeated repeated scroll-behaviour may be due to it since cypress doesn't handle smooth scroll behaviour own its own.
cypress-io/cypress#8675 (comment)

@zackkrida zackkrida changed the title created Cypress e2e test for Stepper Cypress e2e test for Stepper component Jan 20, 2021
Copy link
Member

@zackkrida zackkrida left a comment

Choose a reason for hiding this comment

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

This looks pretty good! However, I see a lot of spelling mistakes. Please run through with a spell checker.

Also, it might be useful to write some custom cypress commands for the really common actions, like cy.get(".next-button").click();, which could become something like:

// https://docs.cypress.io/api/cypress-api/custom-commands.html#Parent-Commands
Cypress.Commands.add('clickNext', () => {
	cy.get('.next-button').click()
})

@Cronus1007
Copy link
Member Author

Also, it might be useful to write some custom cypress commands for the really common actions, like cy.get(".next-button").click();, which could become something like:

@zackkrida Okk let me do the required refactoring then.

@zackkrida
Copy link
Member

Also, it might be useful to write some custom cypress commands for the really common actions, like cy.get(".next-button").click();, which could become something like:

@zackkrida Okk let me do the required refactoring then.

You don't have to do this, just the typos before merging. Up to you!

@Cronus1007
Copy link
Member Author

@zackkrida Actually I was referring the typos as refactoring process.My bad .

@Cronus1007 Cronus1007 requested a review from zackkrida January 21, 2021 03:47
Copy link
Contributor

@obulat obulat left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution, @Cronus1007 !
I've added some refactoring to the tests.

@obulat obulat dismissed zackkrida’s stale review January 21, 2021 15:23

I've done some refactoring, Zack.

@obulat obulat merged commit 0b0fe69 into creativecommons:master Jan 21, 2021
@Cronus1007 Cronus1007 deleted the Stepper branch February 4, 2021 09:48
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.

Create Cypress integration test for Stepper

3 participants