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

🪟 🚦 E2E tests: clean up matchers #20887

Merged
merged 48 commits into from
Jan 19, 2023

Conversation

dizel852
Copy link
Contributor

@dizel852 dizel852 commented Dec 27, 2022

What

Resolves #20722 (1 point)

How

Most of the cleanup work was done on matches(selectors):

  • replace className, div, and other not reliable selectors with appropriate data-testid selectors
  • move unnecessary repeated cy.intercept to beforeEach function
  • improve table click actions;

@octavia-squidington-iv octavia-squidington-iv added area/platform issues related to the platform area/frontend Related to the Airbyte webapp labels Dec 27, 2022
@dizel852 dizel852 changed the title 🪟 🚥 E2E tests: clean up matchers and naming 🪟 🚦 E2E tests: clean up matchers and naming Dec 29, 2022
# Conflicts:
#	airbyte-webapp-e2e-tests/cypress/plugins/index.ts
Copy link
Contributor

@matter-q matter-q left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@teallarson teallarson left a comment

Choose a reason for hiding this comment

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

Have not watched cypress run through this, but it looks like CI likes it 🎉

Bear with me, I had a lot of questions! I think it's close, mostly I just want to clarify some things.

airbyte-webapp-e2e-tests/cypress/pages/helpers/table.ts Outdated Show resolved Hide resolved
airbyte-webapp-e2e-tests/cypress/pages/replicationPage.ts Outdated Show resolved Hide resolved
airbyte-webapp-e2e-tests/cypress/pages/replicationPage.ts Outdated Show resolved Hide resolved
airbyte-webapp-e2e-tests/cypress/pages/replicationPage.ts Outdated Show resolved Hide resolved
cy.get(getFieldDropdownOption(value)).click();
}
});
// close dropdown - click on dropdown overlay if exist
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't both the cursor and primary key field use Popout? Both of those would have an overlay, right?

Curious a few things:

  1. When would the overlay be there or not be there and is that worth documenting somewhere here?
  2. Do we need a tighter matcher at the top of this file for <Overlay /> so we're sure we get the one associated with the <Popout />? We also use the Overlay when there is a modal open and when the new <StreamDetailsPanel /> is open (which I suppose isn't a current concern, but will be soon)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. In case we select the cursor options - there can be just one option selected, so the dropdown closes automatically. Multiple options can be selected in case we select the PK options, so we need to close the dropdown manually.
    Firstly, I did a try to close it when multiple options need to be selected, but since we are in within() context, it's strange, but it can find the body element. I also tried using cy.root and cy.document().its('body').find(...) to find the Overlay in the outer scope, but they weren't successful.
  2. Hm... But we can have just one Overlay at the same time. The reason why we need to click on Overlay - current implementation dropdown. I also tried to click outside, at any element, and tried on the body element - no effect. Only clicking on overlay allows closing the dropdown.
    In the case of Modal - we usually have buttons, like "Ok" and "Cancel", and we don't use Overlay element. Except for just one case - when we need to check the behavior when we click outside of the Modal.

I've added some comments to the code above, why we check Overlay existence.

Copy link
Contributor

@teallarson teallarson left a comment

Choose a reason for hiding this comment

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

LGTM! Excited to have these in 🎉

@dizel852 dizel852 merged commit 7f33f39 into master Jan 19, 2023
@dizel852 dizel852 deleted the vlad/20722-e2e-clean-up-matchers-and-naming branch January 19, 2023 15:21
xiaohansong pushed a commit that referenced this pull request Jan 20, 2023
* improve serviceTypeDropdownOption selector

* add test ids to PathPopout component(s)

* add unique id's to table dropdowns

* extend submitButtonClick to support optional click options

* update dropdown(pathPopout) matchers

* add test-id to Overlay component

* remove redundant function brackets

* revert changes onSubmit button click

* fix dropDown overlay issue

* move all duplicated intercepters to beforeEach

* add test id's to Connections, Sources and Destinations tables

* add table helper functions

* update source page actions

* intercepter fixes

* update createTestConnection function with optional replication settings

* remove extra Connection name check

* replace "cypress-postgres" with "pg-promise" npm package

* update cypress config

* Revert "update createTestConnection function with optional replication settings"

This reverts commit 8e47c78.

* Revert "remove extra Connection name check"

This reverts commit dfb19c7.

* replace openSourceDestinationFromGrid with specific selector

* replace openSourceDestinationFromGrid with specific selector

* turn on test

* add test-id's

* fix selectors

* update test

* update test snapshots

* fix lost data-testid after resolve merge conflicts

* remove extra check

* move clickOnCellInTable helper to common.ts file

* remove empty line and comments

* fix dropdownType

* replace partial string check with exact

* extract interceptors and waiters to separate file

* fix selector for predefined PK

* fix selector

* add comment regarding dropdown
xiaohansong added a commit that referenced this pull request Feb 6, 2023
* api changes for writing discover catalog

* api changes

* format

* worker change 1

* change return type of the API to return catalogId

* worker to call api

* typo

* 🎉 Source GoogleSheets -  migrated SAT to strictness level (#21399)

* migrated SAT to strictness level

* fixed expected records

* revert file from another source

* changed extension to txt

* changed extension to txt

* 🐛Destination-Bigquery: Added an explicit error message if sync fails due to a config issue (#21144)

* [19998] Destination-Bigquery: Added an explicit error message in sync fails due to a config issue

* ci-connector-ops: split workflows(#21474)

* CI:  nightly build alpha sources and destinations (#21562)

* Revert "Change main class in strict-encrypt destination and bump versions on both destinations to keep them in sync (#21509)" (#21567)

This reverts commit 1d202d1.

* Fixes webhook updating logic (#21519)

* ci_credentials: disable tooling test run by tox (#21580)

* disable tox

* rename steps

* revert changes on experimental workflow

* do not install tox

* Revert "CI:  nightly build alpha sources and destinations (#21562)" (#21589)

This reverts commit 61f88f3.

* Security update of default docker images (#21407)

Because there is a lot of CVEs in those releases.

Co-authored-by: Topher Lubaway <[email protected]>

* 📝 add docs for how to add normalization (#21563)

* add docs

* add schema link

* update based on feedback

* 🪟 🚦  E2E tests: clean up matchers (#20887)

* improve serviceTypeDropdownOption selector

* add test ids to PathPopout component(s)

* add unique id's to table dropdowns

* extend submitButtonClick to support optional click options

* update dropdown(pathPopout) matchers

* add test-id to Overlay component

* remove redundant function brackets

* revert changes onSubmit button click

* fix dropDown overlay issue

* move all duplicated intercepters to beforeEach

* add test id's to Connections, Sources and Destinations tables

* add table helper functions

* update source page actions

* intercepter fixes

* update createTestConnection function with optional replication settings

* remove extra Connection name check

* replace "cypress-postgres" with "pg-promise" npm package

* update cypress config

* Revert "update createTestConnection function with optional replication settings"

This reverts commit 8e47c78.

* Revert "remove extra Connection name check"

This reverts commit dfb19c7.

* replace openSourceDestinationFromGrid with specific selector

* replace openSourceDestinationFromGrid with specific selector

* turn on test

* add test-id's

* fix selectors

* update test

* update test snapshots

* fix lost data-testid after resolve merge conflicts

* remove extra check

* move clickOnCellInTable helper to common.ts file

* remove empty line and comments

* fix dropdownType

* replace partial string check with exact

* extract interceptors and waiters to separate file

* fix selector for predefined PK

* fix selector

* add comment regarding dropdown

* 🪟 🎨 [Free connectors] Update modal copy (#21600)

* move start/end time options out of optional block (#21541)

* lingering fix

* reflecting api changes

* test fix

* worker to call api to do discover work

* recovered deleted html

* self review

* more converters refactor

* fix connector test

* fix test

* fix

* fix integration test

* add unit test for converter

* static fix

* api client needs to have a timeout in case request does not get responded

---------

Co-authored-by: midavadim <[email protected]>
Co-authored-by: Eugene <[email protected]>
Co-authored-by: Augustin <[email protected]>
Co-authored-by: Greg Solovyev <[email protected]>
Co-authored-by: Yatsuk Bogdan <[email protected]>
Co-authored-by: Hervé Commowick <[email protected]>
Co-authored-by: Topher Lubaway <[email protected]>
Co-authored-by: Pedro S. Lopez <[email protected]>
Co-authored-by: Vladimir <[email protected]>
Co-authored-by: Joey Marshment-Howell <[email protected]>
Co-authored-by: Lake Mossman <[email protected]>
xiaohansong added a commit that referenced this pull request Feb 7, 2023
* api changes for writing discover catalog

* api changes

* format

* worker change 1

* change return type of the API to return catalogId

* worker to call api

* typo

* 🎉 Source GoogleSheets -  migrated SAT to strictness level (#21399)

* migrated SAT to strictness level

* fixed expected records

* revert file from another source

* changed extension to txt

* changed extension to txt

* 🐛Destination-Bigquery: Added an explicit error message if sync fails due to a config issue (#21144)

* [19998] Destination-Bigquery: Added an explicit error message in sync fails due to a config issue

* ci-connector-ops: split workflows(#21474)

* CI:  nightly build alpha sources and destinations (#21562)

* Revert "Change main class in strict-encrypt destination and bump versions on both destinations to keep them in sync (#21509)" (#21567)

This reverts commit 1d202d1.

* Fixes webhook updating logic (#21519)

* ci_credentials: disable tooling test run by tox (#21580)

* disable tox

* rename steps

* revert changes on experimental workflow

* do not install tox

* Revert "CI:  nightly build alpha sources and destinations (#21562)" (#21589)

This reverts commit 61f88f3.

* Security update of default docker images (#21407)

Because there is a lot of CVEs in those releases.

Co-authored-by: Topher Lubaway <[email protected]>

* 📝 add docs for how to add normalization (#21563)

* add docs

* add schema link

* update based on feedback

* 🪟 🚦  E2E tests: clean up matchers (#20887)

* improve serviceTypeDropdownOption selector

* add test ids to PathPopout component(s)

* add unique id's to table dropdowns

* extend submitButtonClick to support optional click options

* update dropdown(pathPopout) matchers

* add test-id to Overlay component

* remove redundant function brackets

* revert changes onSubmit button click

* fix dropDown overlay issue

* move all duplicated intercepters to beforeEach

* add test id's to Connections, Sources and Destinations tables

* add table helper functions

* update source page actions

* intercepter fixes

* update createTestConnection function with optional replication settings

* remove extra Connection name check

* replace "cypress-postgres" with "pg-promise" npm package

* update cypress config

* Revert "update createTestConnection function with optional replication settings"

This reverts commit 8e47c78.

* Revert "remove extra Connection name check"

This reverts commit dfb19c7.

* replace openSourceDestinationFromGrid with specific selector

* replace openSourceDestinationFromGrid with specific selector

* turn on test

* add test-id's

* fix selectors

* update test

* update test snapshots

* fix lost data-testid after resolve merge conflicts

* remove extra check

* move clickOnCellInTable helper to common.ts file

* remove empty line and comments

* fix dropdownType

* replace partial string check with exact

* extract interceptors and waiters to separate file

* fix selector for predefined PK

* fix selector

* add comment regarding dropdown

* 🪟 🎨 [Free connectors] Update modal copy (#21600)

* move start/end time options out of optional block (#21541)

* lingering fix

* reflecting api changes

* test fix

* reset to master

* routing changes

* remove unexpected merge

* resolve dependency micronaut

* resolve dependency

* format

* fix test

* rename and refactor location of test files

* test

* redo the routing service

* add test to config repository

* query workspace not connection for discover/check

* remove unused bean

---------

Co-authored-by: midavadim <[email protected]>
Co-authored-by: Eugene <[email protected]>
Co-authored-by: Augustin <[email protected]>
Co-authored-by: Greg Solovyev <[email protected]>
Co-authored-by: Yatsuk Bogdan <[email protected]>
Co-authored-by: Hervé Commowick <[email protected]>
Co-authored-by: Topher Lubaway <[email protected]>
Co-authored-by: Pedro S. Lopez <[email protected]>
Co-authored-by: Vladimir <[email protected]>
Co-authored-by: Joey Marshment-Howell <[email protected]>
Co-authored-by: Lake Mossman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/frontend Related to the Airbyte webapp team/platform-move
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clean up matchers in webapp e2e testing
4 participants