File tree Expand file tree Collapse file tree 10 files changed +129
-9
lines changed
Expand file tree Collapse file tree 10 files changed +129
-9
lines changed Original file line number Diff line number Diff line change @@ -2,4 +2,5 @@ node_modules
22dist
33.vscode
44coverage
5- .DS_Store
5+ .DS_Store
6+ ** /output /**
Original file line number Diff line number Diff line change @@ -32,11 +32,8 @@ This module exposes a playwright `selectorEngine`: https://github.com/microsoft/
3232``` javascript
3333const { selectorEngine } = require (" query-selector-shadow-dom/plugins/playwright" );
3434const playwright = require (' playwright' );
35- ...
36- // NOTE: this api was change in playwright 0.12.0 to below in comments
37- // https://github.com/microsoft/playwright/blob/master/docs/api.md#selectorsregistername-script
38- // await selectors.register('shadow', createTagNameEngine);
39- await playwright .selectors .register (selectorEngine, { name: ' shadow' })
35+
36+ await selectors .register (' shadow' , createTagNameEngine);
4037...
4138 await page .goto (' chrome://downloads' );
4239 // shadow= allows a css query selector that automatically pierces shadow roots.
Original file line number Diff line number Diff line change 1+ const { setHeadlessWhen } = require ( '@codeceptjs/configure' ) ;
2+
3+ // turn on headless mode when running with HEADLESS=true environment variable
4+ // HEADLESS=true npx codecept run
5+ setHeadlessWhen ( process . env . HEADLESS ) ;
6+
7+ exports . config = {
8+ tests : 'test/codeceptjs/*.test.js' ,
9+ output : './output' ,
10+ helpers : {
11+ Playwright : {
12+ url : 'http://localhost' ,
13+ show : true ,
14+ browser : 'chromium'
15+ }
16+ } ,
17+ include : {
18+ I : './steps_file.js'
19+ } ,
20+ bootstrap : null ,
21+ mocha : { } ,
22+ name : 'query-selector-shadow-dom' ,
23+ plugins : {
24+ retryFailedStep : {
25+ enabled : true
26+ } ,
27+ screenshotOnFail : {
28+ enabled : true
29+ }
30+ }
31+ }
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ const { selectorEngine } = require("query-selector-shadow-dom/plugins/playwright
22const playwright = require ( 'playwright' )
33
44const main = async ( ) => {
5- await playwright . selectors . register ( selectorEngine , { name : 'shadow' } )
5+ await playwright . selectors . register ( 'shadow' , selectorEngine )
66
77 const browser = await playwright . chromium . launch ( { headless : false } )
88 const context = await browser . newContext ( { viewport : null } )
Original file line number Diff line number Diff line change 1+ {
2+ "compilerOptions" : {
3+ "allowJs" : true
4+ }
5+ }
Original file line number Diff line number Diff line change @@ -10,8 +10,6 @@ Goal/Example: To be able to write a test that works easily with shadow dom web c
1010See Issues for what currently works and what doesn't
1111
1212``` javascript
13- const playwright = require (" playwright" );
14-
1513Feature (" The chrome downloads page" );
1614Scenario (" Can interact with the search box" , async I => {
1715 I .amOnPage (" chrome://downloads" );
Original file line number Diff line number Diff line change 1+ /// <reference types='codeceptjs' />
2+ type steps_file = typeof import ( './steps_file.js' ) ;
3+
4+ declare namespace CodeceptJS {
5+ interface SupportObject { I : CodeceptJS . I }
6+ interface CallbackOrder { [ 0 ] : CodeceptJS . I }
7+ interface Methods extends CodeceptJS . Playwright { }
8+ interface I extends ReturnType < steps_file > { }
9+ namespace Translation {
10+ interface Actions { }
11+ }
12+ }
Original file line number Diff line number Diff line change 1+ // in this file you can append custom step methods to 'I' object
2+
3+ module . exports = function ( ) {
4+ return actor ( {
5+
6+ // Define custom steps here, use 'this' to access default methods of I.
7+ // It is recommended to place a general 'login' function here.
8+
9+ } ) ;
10+ }
Original file line number Diff line number Diff line change 1+ CodeceptJS functions to test:
2+
3+ appendField
4+ attachFile
5+ checkOption
6+ clearField
7+ click
8+ clickLin
9+ dontSee
10+ dontSeeCheckboxIsChecked
11+ dontSeeCookie
12+ dontSeeCurrentUrlEquals
13+ dontSeeElement
14+ dontSeeElementInDOM
15+ dontSeeInField
16+ doubleClick
17+ dragAndDrop
18+ dragSlider
19+ fillField
20+ forceClick
21+ grabAttributeFrom
22+ grabCssPropertyFrom
23+ grabDataFromPerformanceTiming
24+ grabElementBoundingRect
25+ grabHTMLFrom
26+ grabNumberOfVisibleElements
27+ grabPageScrollPosition
28+ grabTextFrom
29+ grabValueFrom
30+ moveCursorTo
31+ openNewTab
32+ pressKey
33+ pressKeyDown
34+ pressKeyUp
35+ rightClick
36+ scrollPageToBottom
37+ scrollPageToTop
38+ scrollTo
39+ see
40+ seeAttributesOnElements
41+ seeCheckboxIsChecked
42+ seeCssPropertiesOnElements
43+ seeElement
44+ seeElementInDO
45+ seeInField
46+ seeNumberOfElements
47+ seeNumberOfVisibleElements
48+ seeTextEquals
49+ selectOptio
50+ uncheckOptio
51+ waitForClickable
52+ waitForDetached
53+ waitForElement
54+ waitForEnabled
55+ waitForInvisible
56+ waitForText
57+ waitForValue
58+ waitForVisible
59+ waitNumberOfVisibleElements
60+ waitToHide
61+ waitUntil
Original file line number Diff line number Diff line change 1+ Feature ( 'components' ) ;
2+
3+ Scenario ( 'test something' , ( I ) => {
4+
5+ } ) ;
You can’t perform that action at this time.
0 commit comments