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

feat(playwright)/new api: .clear(), .blur(), .focus() #3665

Merged
merged 35 commits into from
Jun 4, 2023
Merged
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
4052000
chore: bringing the name of options to a general form
EgorBodnar Apr 21, 2023
eddae7c
FEATURE(new playwright api): add .blur()
EgorBodnar May 15, 2023
6d05ec9
DOC(new playwright api): add .blur()
EgorBodnar May 15, 2023
3393c76
FEATURE(new playwright api): add .blur()
EgorBodnar May 15, 2023
2436345
FEATURE(new playwright api): add .focus()
EgorBodnar May 15, 2023
1a48bd4
DOC(new playwright api): add .focus()
EgorBodnar May 15, 2023
30cff4c
FEATURE(new playwright api): add .blur()
EgorBodnar May 15, 2023
0e3e49b
chore: .focus() example extend
EgorBodnar May 15, 2023
c1bfe27
TEST(new playwright api): focus(), blur()
EgorBodnar May 15, 2023
e2e15ee
bump playwright version
EgorBodnar May 15, 2023
b1f6297
FEATURE(new playwright api): add .clear()
EgorBodnar May 15, 2023
24a2f29
DOC(new playwright api): add .clear()
EgorBodnar May 15, 2023
219eb7b
TEST(new playwright api): add .clear()
EgorBodnar May 15, 2023
1cffaee
chore: change promises in tests to async/await style
EgorBodnar May 17, 2023
2eafe60
FEATURE(new playwright api):generate both regular and promise-based h…
EgorBodnar May 17, 2023
b3ba843
FIX: use `findFields()` instead of default `_locate()` to locate an i…
EgorBodnar May 17, 2023
c358ccb
chore: replacing the old clearField method by new one
EgorBodnar May 29, 2023
bde4a38
chore: run docs script to regenerate doc. | Previous pool requests we…
EgorBodnar May 29, 2023
18a49a4
chore: remove definitions due to moving functionality to the old clea…
EgorBodnar May 29, 2023
882bfcd
CI: playwright install
EgorBodnar May 29, 2023
895d155
CI: playwright install
EgorBodnar May 29, 2023
78f35c3
FEATURE(new playwright api): add .clear() support of the old function…
EgorBodnar Jun 2, 2023
27a3eb0
TEST(new playwright api): add support of the old functionality in cas…
EgorBodnar Jun 2, 2023
c307db6
install playwright@1.32.3
kobenguyent Jun 2, 2023
9d6daa9
install playwright@1.32.3
kobenguyent Jun 2, 2023
8523d87
TEST(new playwright api): check div editable text
EgorBodnar Jun 4, 2023
2e66487
TEST(new playwright api): add support of the old functionality in cas…
EgorBodnar Jun 4, 2023
7d0d27c
FIX(new playwright api): add .clear() support of the old functionalit…
EgorBodnar Jun 4, 2023
772fb36
FEATURE(new playwright api): add .focus()
EgorBodnar Jun 4, 2023
4fd4d60
FEATURE(new playwright api): add .blur()
EgorBodnar Jun 4, 2023
0572369
DOC(new playwright api): add .focus()
EgorBodnar Jun 4, 2023
b4b06cc
TEST(new playwright api): skip test if using old version of the playw…
EgorBodnar Jun 4, 2023
fef31e5
chore: generate doc after merging
EgorBodnar Jun 4, 2023
c4efd65
FEATURE(playwright new api): temporary migrate solution before full m…
EgorBodnar Jun 4, 2023
12ac202
FEATURE(playwright new api): temporary migrate solution before full m…
EgorBodnar Jun 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
FEATURE(new playwright api): add .focus()
EgorBodnar committed Jun 4, 2023
commit 24363458396984073fe0451502f5e3bf1eed3b4f
22 changes: 22 additions & 0 deletions lib/helper/Playwright.js
Original file line number Diff line number Diff line change
@@ -905,6 +905,28 @@ class Playwright extends Helper {
return this._waitForAction();
}

/**
* {{> focus }}
* Calls [focus](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) on the matching element.
* @param {any} [options] [Additional options](https://playwright.dev/docs/api/class-locator#locator-focus) for available options object as 2nd argument.
*
* Examples:
*
* ```js
* I.dontSee('#add-to-cart');
* I.focus('#product-tile')
* I.see('#add-to-cart');
* ```
*
*/
async focus(locator, options = {}) {
const els = await this._locate(locator);
assertElementExists(els, locator, 'Element to focus');
const el = els[0];
await el.focus(options);
return this._waitForAction();
}

/**
* {{> dragAndDrop }}
*