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

New batch of fixes + integration test improvements #489

Merged
merged 2 commits into from
Jan 30, 2024

Conversation

GioSensation
Copy link
Member

@GioSensation GioSensation commented Jan 30, 2024

Reviewer: @shakyShane
Asana: https://app.asana.com/0/0/1206048671514097/f

Description

Apart from the usual minor bug fixes, this includes nice updates to the integration tests:

  1. We now include the https://github.com/duckduckgo/privacy-test-pages repo as a dependency
  2. I've started adopting the privacy test pages for integration tests in a couple of places and will migrate more over time
  3. Now there is a new command to run integration tests, npm run test:integration:fast that skips recompiling the files and uses shorter timeouts and more workers. This enables faster iterations when working on tests locally 💪.

Steps to test

Everything tested.

Signed-off-by: Emanuele Feliziani <feliziani.emanuele@gmail.com>
Signed-off-by: Emanuele Feliziani <feliziani.emanuele@gmail.com>
@GioSensation GioSensation self-assigned this Jan 30, 2024
'signupWithFormInModal': 'pages/signup-in-modal.html',
'loginCovered': 'pages/login-covered.html',
'loginMultistep': 'pages/login-multistep.html'
'overlay': `${localPagesPrefix}/overlay.html`,
Copy link
Member Author

Choose a reason for hiding this comment

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

Referencing either the local path or the privacy test pages path. I will migrate more and more over time.

await page.waitForFunction(selector => Boolean(document.querySelector(selector)?.getAttribute('style')), selector)
// don't make assertions until the element has been scanned
const field = page.locator(selector)
await expect(field).toHaveAttribute('data-ddg-inputtype')
Copy link
Member Author

Choose a reason for hiding this comment

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

I've switched this to use the locator with expect so that playwright automatically pierces the shadow tree and waits for the attribute to be set. Otherwise, I'd have to implement something custom for waitForFunction. This also seems much cleaner.

Copy link
Collaborator

Choose a reason for hiding this comment

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

👌

@@ -21,22 +21,25 @@
"test:passwords": "PASSWORD_STRESS_TEST=true jest generate.test.js",
"test:unit": "jest",
"test:integration": "npm run build && npm run copy-assets && playwright test",
"test:integration:fast": "playwright test --timeout 10000 --workers 8",
Copy link
Member Author

Choose a reason for hiding this comment

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

A shortcut that skips the build, runs with more workers and a shorter timeout so tests fail faster. This is great for faster test iterations. The other is safer (you're always re-creating the build).

{ "html": "rottentomatoes_signup.html", "expectedFailures": ["emailAddress"], "expectedSubmitFalsePositives": 1 },
{ "html": "rottentomatoes_signup.html" },
Copy link
Member Author

Choose a reason for hiding this comment

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

🎉

@GioSensation GioSensation marked this pull request as ready for review January 30, 2024 12:25
Copy link
Collaborator

@shakyShane shakyShane left a comment

Choose a reason for hiding this comment

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

Great stuff :)

await page.waitForFunction(selector => Boolean(document.querySelector(selector)?.getAttribute('style')), selector)
// don't make assertions until the element has been scanned
const field = page.locator(selector)
await expect(field).toHaveAttribute('data-ddg-inputtype')
Copy link
Collaborator

Choose a reason for hiding this comment

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

👌

@GioSensation GioSensation merged commit 03d3e3a into main Jan 30, 2024
1 check passed
@GioSensation GioSensation deleted the ema/new-batch-of-fixes branch January 30, 2024 12:40
CDRussell pushed a commit to duckduckgo/Android that referenced this pull request Jan 30, 2024
Task/Issue URL:
https://app.asana.com/0/1206475855296108/1206475855296108
Autofill Release:
https://github.com/duckduckgo/duckduckgo-autofill/releases/tag/10.1.0


## Description
Updates Autofill to version
[10.1.0](https://github.com/duckduckgo/duckduckgo-autofill/releases/tag/10.1.0).

### Autofill 10.1.0 release notes
## What's Changed
* Support shadow dom by @GioSensation in
duckduckgo/duckduckgo-autofill#485
* New batch of fixes + integration test improvements by @GioSensation in
duckduckgo/duckduckgo-autofill#489
* Update password-related json files (2024-01-17) by @daxmobile in
duckduckgo/duckduckgo-autofill#474
* Bump playwright from 1.38.1 to 1.40.1 by @dependabot in
duckduckgo/duckduckgo-autofill#458
* Update password-related json files (2024-01-26) by @daxmobile in
duckduckgo/duckduckgo-autofill#484
* Bump json-schema-to-typescript from 13.1.1 to 13.1.2 by @dependabot in
duckduckgo/duckduckgo-autofill#479


**Full Changelog**:
duckduckgo/duckduckgo-autofill@10.0.3...10.1.0

## Steps to test
This release has been tested during autofill development. For smoke test
steps see [this
task](https://app.asana.com/0/1198964220583541/1200583647142330/f).

Co-authored-by: GioSensation <GioSensation@users.noreply.github.com>
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.

2 participants