-
Notifications
You must be signed in to change notification settings - Fork 148
Migrate consent integration tests to playwright from webdriver.io - LIBRARIES-2546 #1279
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
base: master
Are you sure you want to change the base?
Conversation
…-vanilla-opt-in.test.ts and Removed all WebDriver.IO Test Cases
|
…-vanilla-opt-in.test.ts and Removed all WebDriver.IO Test Cases
packages/consent/consent-tools-integration-tests/src/page-objects/base-page.ts
Show resolved
Hide resolved
}) | ||
.addActionDestinationSettings( | ||
{ | ||
private async mockCDNSettingsAPI() { |
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.
Can we still use CDNSettingsBuilder? The point is that it also updates remotePlugins correctly, which is important, and it’s an important helper to decouple our tests IMO
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.
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.
Maybe not following -- great that it works, but is it a problem to use CDNSettingsBuilder instead like we were before?
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.
Done.
packages/consent/consent-tools-integration-tests/src/tests/consent-tools-vanilla-opt-in.test.ts
Show resolved
Hide resolved
packages/consent/consent-tools-integration-tests/playwright.config.ts
Outdated
Show resolved
Hide resolved
packages/consent/consent-tools-integration-tests/playwright.config.ts
Outdated
Show resolved
Hide resolved
await this.clearStorage() | ||
} | ||
|
||
getAllTrackingEvents(): any[] { |
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.
Can we use SegmentEvent[] rather than any, like we were before? Ditto anywhere else 'any' is used
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.
I have updated segmentTrackingApiReqs: SegmentEvent[] = []
but had to use fetchIntegrationReqs: CoreExtraContext[] = []
because of a linter error in the private async mockNextIntegrationsAPI() {...}
at the line this.fetchIntegrationReqs.push({ url: request.url() })
. The Error says: 'url' does not exist in type 'SegmentEvent'.
The only interface where url
is available is [CoreExtraContext](https://github.com/segmentio/analytics-next/blob/master/packages/core/src/events/interfaces.ts)
. Being the only interface fitting in this scenario I assume it is fine to use it. What do you think?
"playwright-test:headed": "playwright test --headed", | ||
"playwright-test:debug": "playwright test --debug", | ||
"serve": "http-server public -p 4567", | ||
"server": "http-server --port 5432", |
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.
why have serve and server? can we just use one -- I prefer "serve" just because that's the name we use in signals-integration-tests?
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.
I think I forgot to remove the server. Thanks for pointing that out.
@@ -10,13 +10,20 @@ | |||
"lint": "yarn concurrently 'yarn:eslint .' 'yarn:tsc --noEmit'", |
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.
- Can we remove all the old wdio dependencies?
- Can we update/commit the yarn.lock? (CI is failing)
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.
Done
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.
CI is still failing after pushing yarn.lock. I will look into it separately once all the test cases have been migrated.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1279 +/- ##
=======================================
Coverage 84.02% 84.02%
=======================================
Files 224 224
Lines 5921 5921
Branches 1351 1351
=======================================
Hits 4975 4975
Misses 946 946
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Work In Progress : One Trust Test Case pending
consent-tools-vanilla-opt-in.test.ts
andconsent-tools-vanilla-opt-out.test.ts
packages/consent/consent-tools-integration-tests/src/tests
To execute the tests, run either of the following commands from the root directory of monorepo
Headless:
analytics-next % yarn workspace @internal/consent-tools-integration-tests test:int
Headfull:
analytics-next % yarn workspace @internal/consent-tools-integration-tests test:int-debug