-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New batch of fixes + integration test improvements (#489)
* Form bug fixes Signed-off-by: Emanuele Feliziani <[email protected]> * Update integration tests Signed-off-by: Emanuele Feliziani <[email protected]> --------- Signed-off-by: Emanuele Feliziani <[email protected]>
- Loading branch information
1 parent
d64a4c6
commit 03d3e3a
Showing
21 changed files
with
1,614 additions
and
136 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import {constants} from '../mocks.js' | ||
|
||
import {genericPage} from './genericPage.js' | ||
|
||
/** | ||
* @param {import("@playwright/test").Page} page | ||
*/ | ||
export function shadowDomPage (page) { | ||
class ShadowDomPage { | ||
async navigate () { | ||
await page.goto(constants.pages['shadowDom']) | ||
} | ||
|
||
async showTheForm () { | ||
const toggleBtn = page.locator(`button:has-text("Click here to sign up")`) | ||
await toggleBtn.click() | ||
} | ||
|
||
async clickThePasswordField () { | ||
return genericPage(page).clickThePasswordField() | ||
} | ||
|
||
passwordHasNoIcon () { | ||
return genericPage(page).passwordHasNoIcon() | ||
} | ||
|
||
passwordFieldShowsGenKey () { | ||
return genericPage(page).passwordFieldShowsGenKey() | ||
} | ||
|
||
selectGeneratedPassword () { | ||
return genericPage(page).selectGeneratedPassword() | ||
} | ||
} | ||
|
||
return new ShadowDomPage() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -141,7 +141,6 @@ test.describe('macos', () => { | |
autogenerated: true, | ||
username: constants.fields.email.privateAddress0 | ||
}) | ||
await page.pause() | ||
|
||
await signup.changeEmailFieldTo('[email protected]') | ||
await signup.enterPassword('abcd') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import {createAutofillScript, forwardConsoleMessages} from '../helpers/harness.js' | ||
import {createWebkitMocks, macosContentScopeReplacements} from '../helpers/mocks.webkit.js' | ||
import {test as base} from '@playwright/test' | ||
import {createAvailableInputTypes} from '../helpers/utils.js' | ||
import {constants} from '../helpers/mocks.js' | ||
import {shadowDomPage} from '../helpers/pages/shadowDomPage.js' | ||
|
||
/** | ||
* Tests for various auto-fill scenarios on macos | ||
*/ | ||
const test = base.extend({}) | ||
|
||
const {personalAddress} = constants.fields.email | ||
const password = '123456' | ||
|
||
test.describe('Page with form in shadow DOM', () => { | ||
async function applyScript (page) { | ||
await createAutofillScript() | ||
.replaceAll(macosContentScopeReplacements()) | ||
.platform('macos') | ||
.applyTo(page) | ||
} | ||
|
||
test('form is scanned on click', async ({page}) => { | ||
// enable in-terminal exceptions | ||
await forwardConsoleMessages(page) | ||
await createWebkitMocks() | ||
.withAvailableInputTypes(createAvailableInputTypes()) | ||
.withCredentials({ | ||
id: '01', | ||
username: personalAddress, | ||
password, | ||
credentialsProvider: 'duckduckgo' | ||
}) | ||
.applyTo(page) | ||
|
||
// Load the autofill.js script with replacements | ||
await await applyScript(page) | ||
|
||
const shadowDom = shadowDomPage(page) | ||
await shadowDom.navigate() | ||
|
||
await shadowDom.showTheForm() | ||
|
||
await shadowDom.passwordHasNoIcon() | ||
|
||
await shadowDom.clickThePasswordField() | ||
|
||
await shadowDom.passwordFieldShowsGenKey() | ||
|
||
await shadowDom.selectGeneratedPassword() | ||
}) | ||
}) |
Oops, something went wrong.