SlideShare a Scribd company logo
ITB 2023 cbPlaywright End-to-end Tests with Playwright and TestBox - Eric Petersen.pdf
https://slides.com/elpete/itb2023-cbplaywright
What this talk is
An overview of cbPlaywright
An overview of Playwright Java
How to use the companion
CommandBox library
A few end-to-end testing selector
strategies
Live coding cbPlaywright tests
What this talk isn't
About unit, integration, or any other
kind of testing besides end-to-end (or
browser) tests
Comparison to other end-to-end
testing tools
Deep dive into end-to-end testing best
practices
ITB 2023 cbPlaywright End-to-end Tests with Playwright and TestBox - Eric Petersen.pdf
What is
cbPlaywright?
Includes the necessary jars and drivers to run
Playwright Java
Provides integration with TestBox and ColdBox
tests
Helper methods for making interacting with
Playwright Java easier
What is cbPlaywright?
So...what is
Playwright?
CFML
If Playwright Java
exists...why would I
use cbPlaywright?
Includes the necessary jars
to run Playwright Java
Companion CommandBox module for downloading the
correct platform drivers
Helper functions to turn this....
var screenshotOptions = createObject( "java", "com.microsoft.playwright.Page$ScreenshotOptions" ).init();
var screenshotPath = createObject( "java", "java.nio.file.Paths" ).get(
javacast( "String", expandPath( "/tests/results/screenshotOne.png" ) ), javacast( "String[]", [] )
);
screenshotOptions.setPath( screenshotPath );
page.screenshot( screenshotOptions );
1
2
3
4
5
6
...into this
screenshotPage( page, "/tests/results/screenshotOne.png" );
1
Installation
box install cbPlaywright
Unfortunately, there is more this time....
There's this thing called a driver....
Running the driver from the Playwright Java jars was
finicky
The driver-bundle jar is very large (about 200 MB
unzipped)
The driver-bundle included versions for all the
platforms
You ended up downloading a full driver-bundle for
every cbPlaywright installation.
Interacting with the driver CLI was a pain
CommandBox cbPlaywright
CommandBox cbPlaywright
Installs as a dependency of cbPlaywright
Manages installing the correct driver for your
platform
Automatically downloads a driver on install
Provides a passthrough to the Playwright CLI
# Install the Playwright driver
cbplaywright driver install
# Install Chromium as a test browser
playwright install chromium
1
2
3
4
5
Configuration
// tests/Application.cfc
component {
this.javaSettings = {
loadPaths: directoryList(
rootPath & "modules/cbPlaywright/lib",
true,
"array",
"*jar"
),
loadColdFusionClassPath: true,
reloadOnChange: false
};
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Add the Jar Paths
// tests/Application.cfc
component {
this.mappings[ "/cbPlaywright" ] = rootPath & "/modules/cbPlaywright";
}
1
2
3
4
5
6
Create a Mapping
// .env
CBPLAYWRIGHT_DRIVER_DIR=/path/to/driver/directory
1
2
Set the Driver Path
(OPTIONAL)
Usage
Creating a Test
component extends="cbPlaywright.models.PlaywrightTestCase" {
function run() {
// ...
}
}
1
2
3
4
5
6
7
Extend the Playwright Test Case
component extends="cbPlaywright.models.ColdBoxPlaywrightTestCase" {
function run() {
// ...
}
}
1
2
3
4
5
6
7
component extends="cbPlaywright.models.PlaywrightTestCase" {
function run() {
describe( "Playwright Tests", () => {
it( "can visit the Google homepage", () => {
var browser = launchBrowser( variables.playwright.chromium() );
var page = browser.newPage();
navigate( page, "https://google.com" );
waitForLoadState( page );
expect( page.title() ).toBe( "Google" );
} );
} );
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Visit a Page
component extends="cbPlaywright.models.PlaywrightTestCase" {
function run() {
describe( "Playwright Tests", () => {
it( "can visit the Google homepage", () => {
var browser = launchBrowser( variables.playwright.chromium() );
var page = browser.newPage();
navigate( page, "https://google.com" );
waitForLoadState( page );
expect( page.title() ).toBe( "Google" );
} );
} );
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
var browser = launchBrowser( variables.playwright.chromium() );
component extends="cbPlaywright.models.PlaywrightTestCase" {
1
2
function run() {
3
describe( "Playwright Tests", () => {
4
it( "can visit the Google homepage", () => {
5
6
var page = browser.newPage();
7
navigate( page, "https://google.com" );
8
waitForLoadState( page );
9
expect( page.title() ).toBe( "Google" );
10
} );
11
} );
12
}
13
14
}
15
Visit a Page
component extends="cbPlaywright.models.PlaywrightTestCase" {
function run() {
describe( "Playwright Tests", () => {
it( "can visit the Google homepage", () => {
var browser = launchBrowser( variables.playwright.chromium() );
var page = browser.newPage();
navigate( page, "https://google.com" );
waitForLoadState( page );
expect( page.title() ).toBe( "Google" );
} );
} );
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
var browser = launchBrowser( variables.playwright.chromium() );
component extends="cbPlaywright.models.PlaywrightTestCase" {
1
2
function run() {
3
describe( "Playwright Tests", () => {
4
it( "can visit the Google homepage", () => {
5
6
var page = browser.newPage();
7
navigate( page, "https://google.com" );
8
waitForLoadState( page );
9
expect( page.title() ).toBe( "Google" );
10
} );
11
} );
12
}
13
14
}
15
var page = browser.newPage();
component extends="cbPlaywright.models.PlaywrightTestCase" {
1
2
function run() {
3
describe( "Playwright Tests", () => {
4
it( "can visit the Google homepage", () => {
5
var browser = launchBrowser( variables.playwright.chromium() );
6
7
navigate( page, "https://google.com" );
8
waitForLoadState( page );
9
expect( page.title() ).toBe( "Google" );
10
} );
11
} );
12
}
13
14
}
15
Visit a Page
component extends="cbPlaywright.models.PlaywrightTestCase" {
function run() {
describe( "Playwright Tests", () => {
it( "can visit the Google homepage", () => {
var browser = launchBrowser( variables.playwright.chromium() );
var page = browser.newPage();
navigate( page, "https://google.com" );
waitForLoadState( page );
expect( page.title() ).toBe( "Google" );
} );
} );
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
var browser = launchBrowser( variables.playwright.chromium() );
component extends="cbPlaywright.models.PlaywrightTestCase" {
1
2
function run() {
3
describe( "Playwright Tests", () => {
4
it( "can visit the Google homepage", () => {
5
6
var page = browser.newPage();
7
navigate( page, "https://google.com" );
8
waitForLoadState( page );
9
expect( page.title() ).toBe( "Google" );
10
} );
11
} );
12
}
13
14
}
15
var page = browser.newPage();
component extends="cbPlaywright.models.PlaywrightTestCase" {
1
2
function run() {
3
describe( "Playwright Tests", () => {
4
it( "can visit the Google homepage", () => {
5
var browser = launchBrowser( variables.playwright.chromium() );
6
7
navigate( page, "https://google.com" );
8
waitForLoadState( page );
9
expect( page.title() ).toBe( "Google" );
10
} );
11
} );
12
}
13
14
}
15
navigate( page, "https://google.com" );
waitForLoadState( page );
component extends="cbPlaywright.models.PlaywrightTestCase" {
1
2
function run() {
3
describe( "Playwright Tests", () => {
4
it( "can visit the Google homepage", () => {
5
var browser = launchBrowser( variables.playwright.chromium() );
6
var page = browser.newPage();
7
8
9
expect( page.title() ).toBe( "Google" );
10
} );
11
} );
12
}
13
14
}
15
Visit a Page
component extends="cbPlaywright.models.PlaywrightTestCase" {
function run() {
describe( "Playwright Tests", () => {
it( "can visit the Google homepage", () => {
var browser = launchBrowser( variables.playwright.chromium() );
var page = browser.newPage();
navigate( page, "https://google.com" );
waitForLoadState( page );
expect( page.title() ).toBe( "Google" );
} );
} );
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
var browser = launchBrowser( variables.playwright.chromium() );
component extends="cbPlaywright.models.PlaywrightTestCase" {
1
2
function run() {
3
describe( "Playwright Tests", () => {
4
it( "can visit the Google homepage", () => {
5
6
var page = browser.newPage();
7
navigate( page, "https://google.com" );
8
waitForLoadState( page );
9
expect( page.title() ).toBe( "Google" );
10
} );
11
} );
12
}
13
14
}
15
var page = browser.newPage();
component extends="cbPlaywright.models.PlaywrightTestCase" {
1
2
function run() {
3
describe( "Playwright Tests", () => {
4
it( "can visit the Google homepage", () => {
5
var browser = launchBrowser( variables.playwright.chromium() );
6
7
navigate( page, "https://google.com" );
8
waitForLoadState( page );
9
expect( page.title() ).toBe( "Google" );
10
} );
11
} );
12
}
13
14
}
15
navigate( page, "https://google.com" );
waitForLoadState( page );
component extends="cbPlaywright.models.PlaywrightTestCase" {
1
2
function run() {
3
describe( "Playwright Tests", () => {
4
it( "can visit the Google homepage", () => {
5
var browser = launchBrowser( variables.playwright.chromium() );
6
var page = browser.newPage();
7
8
9
expect( page.title() ).toBe( "Google" );
10
} );
11
} );
12
}
13
14
}
15
expect( page.title() ).toBe( "Google" );
component extends="cbPlaywright.models.PlaywrightTestCase" {
1
2
function run() {
3
describe( "Playwright Tests", () => {
4
it( "can visit the Google homepage", () => {
5
var browser = launchBrowser( variables.playwright.chromium() );
6
var page = browser.newPage();
7
navigate( page, "https://google.com" );
8
waitForLoadState( page );
9
10
} );
11
} );
12
}
13
14
}
15
Visit a Page
component extends="cbPlaywright.models.PlaywrightTestCase" {
function run() {
describe( "Playwright Tests", () => {
it( "can perform a search on Google", () => {
var browser = launchBrowser( variables.playwright.chromium() );
var page = browser.newPage();
navigate( page, "https://google.com" );
waitForLoadState( page );
var searchBox = locateElement( page, '[aria-label="Search"]' );
fill( searchBox, "playwright" );
press( searchBox, "Enter" );
expect( page.url() ).toInclude( "https://www.google.com/search?q=playwright" );
} );
} );
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Fill Out a Form
component extends="cbPlaywright.models.PlaywrightTestCase" {
function run() {
describe( "Playwright Tests", () => {
it( "can perform a search on Google", () => {
var browser = launchBrowser( variables.playwright.chromium() );
var page = browser.newPage();
navigate( page, "https://google.com" );
waitForLoadState( page );
var searchBox = locateElement( page, '[aria-label="Search"]' );
fill( searchBox, "playwright" );
press( searchBox, "Enter" );
expect( page.url() ).toInclude( "https://www.google.com/search?q=playwright" );
} );
} );
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
var searchBox = locateElement( page, '[aria-label="Search"]' );
fill( searchBox, "playwright" );
press( searchBox, "Enter" );
expect( page.url() ).toInclude( "https://www.google.com/search?q=playwright" );
component extends="cbPlaywright.models.PlaywrightTestCase" {
1
2
function run() {
3
describe( "Playwright Tests", () => {
4
it( "can perform a search on Google", () => {
5
var browser = launchBrowser( variables.playwright.chromium() );
6
var page = browser.newPage();
7
navigate( page, "https://google.com" );
8
waitForLoadState( page );
9
10
11
12
13
14
15
} );
16
} );
17
}
18
19
}
20
Fill Out a Form
What makes a
good Selector?
Role
Label Text
Placeholder Text
Text
Display Value
What makes a good Selector?
https://testing-library.com/docs/queries/about
1. Queries Accessible
to Everyone
2. Semantic Queries 3. Test IDs
Alt Text
Title
component extends="cbPlaywright.models.PlaywrightTestCase" {
function run() {
describe( "Playwright Tests", () => {
it( "can visit the Google homepage", () => {
var browser = launchBrowser( variables.playwright.chromium() );
var page = browser.newPage();
navigate( page, "https://google.com" );
waitForLoadState( page );
expect( page.title() ).toBe( "Google" );
screenshotPage( page, "/tests/results/homepage.png" );
} );
} );
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Take a Screenshot
component extends="cbPlaywright.models.PlaywrightTestCase" {
function run() {
describe( "Playwright Tests", () => {
it( "can visit the Google homepage", () => {
var browser = launchBrowser( variables.playwright.chromium() );
var page = browser.newPage();
navigate( page, "https://google.com" );
waitForLoadState( page );
expect( page.title() ).toBe( "Google" );
screenshotPage( page, "/tests/results/homepage.png" );
} );
} );
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
screenshotPage( page, "/tests/results/homepage.png" );
component extends="cbPlaywright.models.PlaywrightTestCase" {
1
2
function run() {
3
describe( "Playwright Tests", () => {
4
it( "can visit the Google homepage", () => {
5
var browser = launchBrowser( variables.playwright.chromium() );
6
var page = browser.newPage();
7
navigate( page, "https://google.com" );
8
waitForLoadState( page );
9
expect( page.title() ).toBe( "Google" );
10
11
} );
12
} );
13
}
14
15
}
16
Take a Screenshot
component extends="cbPlaywright.models.PlaywrightTestCase" {
function run() {
describe( "Playwright Tests", () => {
it( "fill out the search form and click a link", () => {
var browser = launchBrowser( variables.playwright.chromium() );
newRecordedContextForBrowser( browser, "/tests/results/videos", ( context ) => {
var page = context.newPage();
navigate( page, "https://google.com" );
waitForLoadState( page );
var searchBox = locateElement( page, '[aria-label="Search"]' );
fill( searchBox, "playwright" );
press( searchBox, "Enter" );
expect( page.url() ).toInclude( "https://www.google.com/search?q=playwright" );
click(
locateElement(
page,
"text=Playwright: Fast and reliable end-to-end testing for modern ..."
)
);
waitForUrl( page, "https://playwright.dev/" );
} );
} );
} );
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Record a Video
component extends="cbPlaywright.models.PlaywrightTestCase" {
function run() {
describe( "Playwright Tests", () => {
it( "fill out the search form and click a link", () => {
var browser = launchBrowser( variables.playwright.chromium() );
newRecordedContextForBrowser( browser, "/tests/results/videos", ( context ) => {
var page = context.newPage();
navigate( page, "https://google.com" );
waitForLoadState( page );
var searchBox = locateElement( page, '[aria-label="Search"]' );
fill( searchBox, "playwright" );
press( searchBox, "Enter" );
expect( page.url() ).toInclude( "https://www.google.com/search?q=playwright" );
click(
locateElement(
page,
"text=Playwright: Fast and reliable end-to-end testing for modern ..."
)
);
waitForUrl( page, "https://playwright.dev/" );
} );
} );
} );
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
newRecordedContextForBrowser( browser, "/tests/results/videos", ( context ) => {
} );
component extends="cbPlaywright.models.PlaywrightTestCase" {
1
2
function run() {
3
describe( "Playwright Tests", () => {
4
it( "fill out the search form and click a link", () => {
5
var browser = launchBrowser( variables.playwright.chromium() );
6
7
var page = context.newPage();
8
navigate( page, "https://google.com" );
9
waitForLoadState( page );
10
11
var searchBox = locateElement( page, '[aria-label="Search"]' );
12
fill( searchBox, "playwright" );
13
press( searchBox, "Enter" );
14
15
expect( page.url() ).toInclude( "https://www.google.com/search?q=playwright" );
16
17
click(
18
locateElement(
19
page,
20
"text=Playwright: Fast and reliable end-to-end testing for modern ..."
21
)
22
);
23
24
waitForUrl( page, "https://playwright.dev/" );
25
26
} );
27
} );
28
}
29
30
}
31
Record a Video
component extends="cbPlaywright.models.PlaywrightTestCase" {
function run() {
describe( "Playwright Tests", () => {
it( "fill out the search form and click a link", () => {
var browser = launchBrowser( variables.playwright.chromium() );
newRecordedContextForBrowser( browser, "/tests/results/videos", ( context ) => {
var page = context.newPage();
navigate( page, "https://google.com" );
waitForLoadState( page );
var searchBox = locateElement( page, '[aria-label="Search"]' );
fill( searchBox, "playwright" );
press( searchBox, "Enter" );
expect( page.url() ).toInclude( "https://www.google.com/search?q=playwright" );
click(
locateElement(
page,
"text=Playwright: Fast and reliable end-to-end testing for modern ..."
)
);
waitForUrl( page, "https://playwright.dev/" );
} );
} );
} );
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
newRecordedContextForBrowser( browser, "/tests/results/videos", ( context ) => {
} );
component extends="cbPlaywright.models.PlaywrightTestCase" {
1
2
function run() {
3
describe( "Playwright Tests", () => {
4
it( "fill out the search form and click a link", () => {
5
var browser = launchBrowser( variables.playwright.chromium() );
6
7
var page = context.newPage();
8
navigate( page, "https://google.com" );
9
waitForLoadState( page );
10
11
var searchBox = locateElement( page, '[aria-label="Search"]' );
12
fill( searchBox, "playwright" );
13
press( searchBox, "Enter" );
14
15
expect( page.url() ).toInclude( "https://www.google.com/search?q=playwright" );
16
17
click(
18
locateElement(
19
page,
20
"text=Playwright: Fast and reliable end-to-end testing for modern ..."
21
)
22
);
23
24
waitForUrl( page, "https://playwright.dev/" );
25
26
} );
27
} );
28
}
29
30
}
31
newRecordedContextForBrowser( browser, "/tests/results/videos", ( context ) => {
var page = context.newPage();
} );
component extends="cbPlaywright.models.PlaywrightTestCase" {
1
2
function run() {
3
describe( "Playwright Tests", () => {
4
it( "fill out the search form and click a link", () => {
5
var browser = launchBrowser( variables.playwright.chromium() );
6
7
8
navigate( page, "https://google.com" );
9
waitForLoadState( page );
10
11
var searchBox = locateElement( page, '[aria-label="Search"]' );
12
fill( searchBox, "playwright" );
13
press( searchBox, "Enter" );
14
15
expect( page.url() ).toInclude( "https://www.google.com/search?q=playwright" );
16
17
click(
18
locateElement(
19
page,
20
"text=Playwright: Fast and reliable end-to-end testing for modern ..."
21
)
22
);
23
24
waitForUrl( page, "https://playwright.dev/" );
25
26
} );
27
} );
28
}
29
30
}
31
Record a Video
component extends="cbPlaywright.models.PlaywrightTestCase" {
function run() {
describe( "Playwright Tests", () => {
it( "fill out the search form and click a link", () => {
var browser = launchBrowser( variables.playwright.chromium() );
var context = browser.newContext();
traceContext( context, "/tests/results/trace.zip", function() {
var page = context.newPage();
navigate( page, "https://google.com" );
waitForLoadState( page );
var searchBox = locateElement( page, '[aria-label="Search"]' );
fill( searchBox, "playwright" );
press( searchBox, "Enter" );
expect( page.url() ).toInclude( "https://www.google.com/search?q=playwright" );
click(
locateElement(
page,
"text=Playwright: Fast and reliable end-to-end testing for modern ..."
)
);
waitForUrl( page, "https://playwright.dev/" );
} );
} );
} );
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Save a Trace
component extends="cbPlaywright.models.PlaywrightTestCase" {
function run() {
describe( "Playwright Tests", () => {
it( "fill out the search form and click a link", () => {
var browser = launchBrowser( variables.playwright.chromium() );
var context = browser.newContext();
traceContext( context, "/tests/results/trace.zip", function() {
var page = context.newPage();
navigate( page, "https://google.com" );
waitForLoadState( page );
var searchBox = locateElement( page, '[aria-label="Search"]' );
fill( searchBox, "playwright" );
press( searchBox, "Enter" );
expect( page.url() ).toInclude( "https://www.google.com/search?q=playwright" );
click(
locateElement(
page,
"text=Playwright: Fast and reliable end-to-end testing for modern ..."
)
);
waitForUrl( page, "https://playwright.dev/" );
} );
} );
} );
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
var page = context.newPage();
} );
component extends="cbPlaywright.models.PlaywrightTestCase" {
1
function run() {
2
describe( "Playwright Tests", () => {
3
it( "fill out the search form and click a link", () => {
4
var browser = launchBrowser( variables.playwright.chromium() );
5
var context = browser.newContext();
6
traceContext( context, "/tests/results/trace.zip", function() {
7
8
navigate( page, "https://google.com" );
9
waitForLoadState( page );
10
11
var searchBox = locateElement( page, '[aria-label="Search"]' );
12
fill( searchBox, "playwright" );
13
press( searchBox, "Enter" );
14
15
expect( page.url() ).toInclude( "https://www.google.com/search?q=playwright" );
16
17
click(
18
locateElement(
19
page,
20
"text=Playwright: Fast and reliable end-to-end testing for modern ..."
21
)
22
);
23
24
waitForUrl( page, "https://playwright.dev/" );
25
} );
26
27
} );
28
}
29
}
30
Save a Trace
Save a Trace
Demo
Bonus
name: PRs and Branches
on:
- push
jobs:
tests:
runs-on: ubuntu-latest
name: Tests
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup Java JDK
uses: actions/setup-java@v1.4.3
with:
java-version: 11
- name: Set Up CommandBox
uses: elpete/setup-commandbox@v1.0.0
- name: Install dependencies
run: box install
- name: Start server
run: box server start
- name: Install Playwright dependencies
run: |
box playwright-cli install-deps
box playwright-cli install chromium
- name: Run TestBox Tests
run: box testbox run
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
GitHub Actions
name: PRs and Branches
on:
- push
jobs:
tests:
runs-on: ubuntu-latest
name: Tests
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup Java JDK
uses: actions/setup-java@v1.4.3
with:
java-version: 11
- name: Set Up CommandBox
uses: elpete/setup-commandbox@v1.0.0
- name: Install dependencies
run: box install
- name: Start server
run: box server start
- name: Install Playwright dependencies
run: |
box playwright-cli install-deps
box playwright-cli install chromium
- name: Run TestBox Tests
run: box testbox run
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
- name: Checkout Repository
name: PRs and Branches
1
2
on:
3
- push
4
5
jobs:
6
tests:
7
runs-on: ubuntu-latest
8
name: Tests
9
steps:
10
11
uses: actions/checkout@v2
12
13
- name: Setup Java JDK
14
uses: actions/setup-java@v1.4.3
15
with:
16
java-version: 11
17
18
- name: Set Up CommandBox
19
uses: elpete/setup-commandbox@v1.0.0
20
21
- name: Install dependencies
22
run: box install
23
24
- name: Start server
25
run: box server start
26
27
- name: Install Playwright dependencies
28
run: |
29
box playwright-cli install-deps
30
box playwright-cli install chromium
31
32
- name: Run TestBox Tests
33
run: box testbox run
34
GitHub Actions
ITB 2023 cbPlaywright End-to-end Tests with Playwright and TestBox - Eric Petersen.pdf
Ad

More Related Content

Similar to ITB 2023 cbPlaywright End-to-end Tests with Playwright and TestBox - Eric Petersen.pdf (20)

Multi Client Development with Spring - Josh Long
Multi Client Development with Spring - Josh Long Multi Client Development with Spring - Josh Long
Multi Client Development with Spring - Josh Long
jaxconf
 
Denver emberjs-sept-2015
Denver emberjs-sept-2015Denver emberjs-sept-2015
Denver emberjs-sept-2015
Ron White
 
Testing frontends with nightwatch & saucelabs
Testing frontends with nightwatch & saucelabsTesting frontends with nightwatch & saucelabs
Testing frontends with nightwatch & saucelabs
Tudor Barbu
 
DrupalCon Dublin 2016 - Automated browser testing with Nightwatch.js
DrupalCon Dublin 2016 - Automated browser testing with Nightwatch.jsDrupalCon Dublin 2016 - Automated browser testing with Nightwatch.js
DrupalCon Dublin 2016 - Automated browser testing with Nightwatch.js
Vladimir Roudakov
 
Search and play more than 50 clips
Search and play more than 50 clipsSearch and play more than 50 clips
Search and play more than 50 clips
phanhung20
 
Angular 2 introduction
Angular 2 introductionAngular 2 introduction
Angular 2 introduction
Christoffer Noring
 
How to replace rails asset pipeline with webpack?
How to replace rails asset pipeline with webpack?How to replace rails asset pipeline with webpack?
How to replace rails asset pipeline with webpack?
Tomasz Bak
 
A few good JavaScript development tools
A few good JavaScript development toolsA few good JavaScript development tools
A few good JavaScript development tools
Simon Kim
 
greach 2014 marco vermeulen bdd using cucumber jvm and groovy
greach 2014 marco vermeulen bdd using cucumber jvm and groovygreach 2014 marco vermeulen bdd using cucumber jvm and groovy
greach 2014 marco vermeulen bdd using cucumber jvm and groovy
Jessie Evangelista
 
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasmineSingle Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Paulo Ragonha
 
Construire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradleConstruire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradle
Thierry Wasylczenko
 
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Matt Raible
 
Javascript unit testing, yes we can e big
Javascript unit testing, yes we can   e bigJavascript unit testing, yes we can   e big
Javascript unit testing, yes we can e big
Andy Peterson
 
SF Grails - Ratpack - Compact Groovy Webapps - James Williams
SF Grails - Ratpack - Compact Groovy Webapps - James WilliamsSF Grails - Ratpack - Compact Groovy Webapps - James Williams
SF Grails - Ratpack - Compact Groovy Webapps - James Williams
Philip Stehlik
 
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Tsuyoshi Yamamoto
 
Testing ASP.net Web Applications using Ruby
Testing ASP.net Web Applications using RubyTesting ASP.net Web Applications using Ruby
Testing ASP.net Web Applications using Ruby
Ben Hall
 
CasperJs Enjoy Functional Testing
CasperJs Enjoy Functional TestingCasperJs Enjoy Functional Testing
CasperJs Enjoy Functional Testing
Fabien POMEROL
 
Revolution or Evolution in Page Object
Revolution or Evolution in Page ObjectRevolution or Evolution in Page Object
Revolution or Evolution in Page Object
Artem Sokovets
 
Protractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applicationsProtractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applications
Ludmila Nesvitiy
 
Rapid prototyping and easy testing with ember cli mirage
Rapid prototyping and easy testing with ember cli mirageRapid prototyping and easy testing with ember cli mirage
Rapid prototyping and easy testing with ember cli mirage
Krzysztof Bialek
 
Multi Client Development with Spring - Josh Long
Multi Client Development with Spring - Josh Long Multi Client Development with Spring - Josh Long
Multi Client Development with Spring - Josh Long
jaxconf
 
Denver emberjs-sept-2015
Denver emberjs-sept-2015Denver emberjs-sept-2015
Denver emberjs-sept-2015
Ron White
 
Testing frontends with nightwatch & saucelabs
Testing frontends with nightwatch & saucelabsTesting frontends with nightwatch & saucelabs
Testing frontends with nightwatch & saucelabs
Tudor Barbu
 
DrupalCon Dublin 2016 - Automated browser testing with Nightwatch.js
DrupalCon Dublin 2016 - Automated browser testing with Nightwatch.jsDrupalCon Dublin 2016 - Automated browser testing with Nightwatch.js
DrupalCon Dublin 2016 - Automated browser testing with Nightwatch.js
Vladimir Roudakov
 
Search and play more than 50 clips
Search and play more than 50 clipsSearch and play more than 50 clips
Search and play more than 50 clips
phanhung20
 
How to replace rails asset pipeline with webpack?
How to replace rails asset pipeline with webpack?How to replace rails asset pipeline with webpack?
How to replace rails asset pipeline with webpack?
Tomasz Bak
 
A few good JavaScript development tools
A few good JavaScript development toolsA few good JavaScript development tools
A few good JavaScript development tools
Simon Kim
 
greach 2014 marco vermeulen bdd using cucumber jvm and groovy
greach 2014 marco vermeulen bdd using cucumber jvm and groovygreach 2014 marco vermeulen bdd using cucumber jvm and groovy
greach 2014 marco vermeulen bdd using cucumber jvm and groovy
Jessie Evangelista
 
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasmineSingle Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Paulo Ragonha
 
Construire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradleConstruire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradle
Thierry Wasylczenko
 
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Matt Raible
 
Javascript unit testing, yes we can e big
Javascript unit testing, yes we can   e bigJavascript unit testing, yes we can   e big
Javascript unit testing, yes we can e big
Andy Peterson
 
SF Grails - Ratpack - Compact Groovy Webapps - James Williams
SF Grails - Ratpack - Compact Groovy Webapps - James WilliamsSF Grails - Ratpack - Compact Groovy Webapps - James Williams
SF Grails - Ratpack - Compact Groovy Webapps - James Williams
Philip Stehlik
 
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Tsuyoshi Yamamoto
 
Testing ASP.net Web Applications using Ruby
Testing ASP.net Web Applications using RubyTesting ASP.net Web Applications using Ruby
Testing ASP.net Web Applications using Ruby
Ben Hall
 
CasperJs Enjoy Functional Testing
CasperJs Enjoy Functional TestingCasperJs Enjoy Functional Testing
CasperJs Enjoy Functional Testing
Fabien POMEROL
 
Revolution or Evolution in Page Object
Revolution or Evolution in Page ObjectRevolution or Evolution in Page Object
Revolution or Evolution in Page Object
Artem Sokovets
 
Protractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applicationsProtractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applications
Ludmila Nesvitiy
 
Rapid prototyping and easy testing with ember cli mirage
Rapid prototyping and easy testing with ember cli mirageRapid prototyping and easy testing with ember cli mirage
Rapid prototyping and easy testing with ember cli mirage
Krzysztof Bialek
 

More from Ortus Solutions, Corp (20)

Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
I am afraid of no test! The power of BDD
I am afraid of no test! The power of BDDI am afraid of no test! The power of BDD
I am afraid of no test! The power of BDD
Ortus Solutions, Corp
 
BoxLang JVM Language : The Future is Dynamic
BoxLang JVM Language : The Future is DynamicBoxLang JVM Language : The Future is Dynamic
BoxLang JVM Language : The Future is Dynamic
Ortus Solutions, Corp
 
Building Dynamic AWS Lambda Applications with BoxLang
Building Dynamic AWS Lambda Applications with BoxLangBuilding Dynamic AWS Lambda Applications with BoxLang
Building Dynamic AWS Lambda Applications with BoxLang
Ortus Solutions, Corp
 
A Summary of “Out of the Tar Pit” by Jacob Beers
A Summary of “Out of the Tar Pit” by Jacob BeersA Summary of “Out of the Tar Pit” by Jacob Beers
A Summary of “Out of the Tar Pit” by Jacob Beers
Ortus Solutions, Corp
 
Modern Functional Fluent CFML REST by Luis Majano
Modern Functional Fluent CFML REST by Luis MajanoModern Functional Fluent CFML REST by Luis Majano
Modern Functional Fluent CFML REST by Luis Majano
Ortus Solutions, Corp
 
BoxLang DNA - Feature: World-Class Support
BoxLang DNA - Feature: World-Class SupportBoxLang DNA - Feature: World-Class Support
BoxLang DNA - Feature: World-Class Support
Ortus Solutions, Corp
 
ITB 2023 cbq - Jobs And Tasks In the Background - Eric Peterson.pdf
ITB 2023 cbq - Jobs And Tasks In the Background - Eric Peterson.pdfITB 2023 cbq - Jobs And Tasks In the Background - Eric Peterson.pdf
ITB 2023 cbq - Jobs And Tasks In the Background - Eric Peterson.pdf
Ortus Solutions, Corp
 
ITB 2023 - cbElasticSearch Modern Searching for Modern CFML - Jon Clausen.pdf
ITB 2023 - cbElasticSearch Modern Searching for Modern CFML - Jon Clausen.pdfITB 2023 - cbElasticSearch Modern Searching for Modern CFML - Jon Clausen.pdf
ITB 2023 - cbElasticSearch Modern Searching for Modern CFML - Jon Clausen.pdf
Ortus Solutions, Corp
 
ITB 2023 Modernizing the App A tale from the trenches- David Paul Belanger.pdf
ITB 2023 Modernizing the App A tale from the trenches- David Paul Belanger.pdfITB 2023 Modernizing the App A tale from the trenches- David Paul Belanger.pdf
ITB 2023 Modernizing the App A tale from the trenches- David Paul Belanger.pdf
Ortus Solutions, Corp
 
ITB 2023 Creating and managing a QA focused production-replicating environmen...
ITB 2023 Creating and managing a QA focused production-replicating environmen...ITB 2023 Creating and managing a QA focused production-replicating environmen...
ITB 2023 Creating and managing a QA focused production-replicating environmen...
Ortus Solutions, Corp
 
ITB 2023 10 Techniques for writing easy yet stupidly thorough unit tests_Dan ...
ITB 2023 10 Techniques for writing easy yet stupidly thorough unit tests_Dan ...ITB 2023 10 Techniques for writing easy yet stupidly thorough unit tests_Dan ...
ITB 2023 10 Techniques for writing easy yet stupidly thorough unit tests_Dan ...
Ortus Solutions, Corp
 
ITB 2023 Headless eCommerce with CFML - Jon Clausen.pdf
ITB 2023 Headless eCommerce with CFML - Jon Clausen.pdfITB 2023 Headless eCommerce with CFML - Jon Clausen.pdf
ITB 2023 Headless eCommerce with CFML - Jon Clausen.pdf
Ortus Solutions, Corp
 
Crash Course in CSS Grid plus FlexBox - Nolan Erck
Crash Course in CSS Grid plus FlexBox - Nolan ErckCrash Course in CSS Grid plus FlexBox - Nolan Erck
Crash Course in CSS Grid plus FlexBox - Nolan Erck
Ortus Solutions, Corp
 
ITB 2023 - 800 Pounds Gorilla - a Design session for no designers - Jona Lain...
ITB 2023 - 800 Pounds Gorilla - a Design session for no designers - Jona Lain...ITB 2023 - 800 Pounds Gorilla - a Design session for no designers - Jona Lain...
ITB 2023 - 800 Pounds Gorilla - a Design session for no designers - Jona Lain...
Ortus Solutions, Corp
 
ITB 2023 - The Many Layers of OAuth - Keith Casey .pdf
ITB 2023 - The Many Layers of OAuth - Keith Casey .pdfITB 2023 - The Many Layers of OAuth - Keith Casey .pdf
ITB 2023 - The Many Layers of OAuth - Keith Casey .pdf
Ortus Solutions, Corp
 
ITB 2023 - Chatgpt Box! AI All The Things - Scott Steinbeck.pdf
ITB 2023 - Chatgpt Box! AI All The Things - Scott Steinbeck.pdfITB 2023 - Chatgpt Box! AI All The Things - Scott Steinbeck.pdf
ITB 2023 - Chatgpt Box! AI All The Things - Scott Steinbeck.pdf
Ortus Solutions, Corp
 
ITB 2023 Build Vue Apps Using tdd (Test-Driven Development).pptx
ITB 2023 Build Vue Apps Using tdd (Test-Driven Development).pptxITB 2023 Build Vue Apps Using tdd (Test-Driven Development).pptx
ITB 2023 Build Vue Apps Using tdd (Test-Driven Development).pptx
Ortus Solutions, Corp
 
ITB 2023 - Create as many web sites or web apps as you want - George Murphy.pdf
ITB 2023 - Create as many web sites or web apps as you want - George Murphy.pdfITB 2023 - Create as many web sites or web apps as you want - George Murphy.pdf
ITB 2023 - Create as many web sites or web apps as you want - George Murphy.pdf
Ortus Solutions, Corp
 
ITB 2023 qb, Migration, Seeders. Recipe For Success - Gavin-Pickin.pdf
ITB 2023 qb, Migration, Seeders. Recipe For Success - Gavin-Pickin.pdfITB 2023 qb, Migration, Seeders. Recipe For Success - Gavin-Pickin.pdf
ITB 2023 qb, Migration, Seeders. Recipe For Success - Gavin-Pickin.pdf
Ortus Solutions, Corp
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
I am afraid of no test! The power of BDD
I am afraid of no test! The power of BDDI am afraid of no test! The power of BDD
I am afraid of no test! The power of BDD
Ortus Solutions, Corp
 
BoxLang JVM Language : The Future is Dynamic
BoxLang JVM Language : The Future is DynamicBoxLang JVM Language : The Future is Dynamic
BoxLang JVM Language : The Future is Dynamic
Ortus Solutions, Corp
 
Building Dynamic AWS Lambda Applications with BoxLang
Building Dynamic AWS Lambda Applications with BoxLangBuilding Dynamic AWS Lambda Applications with BoxLang
Building Dynamic AWS Lambda Applications with BoxLang
Ortus Solutions, Corp
 
A Summary of “Out of the Tar Pit” by Jacob Beers
A Summary of “Out of the Tar Pit” by Jacob BeersA Summary of “Out of the Tar Pit” by Jacob Beers
A Summary of “Out of the Tar Pit” by Jacob Beers
Ortus Solutions, Corp
 
Modern Functional Fluent CFML REST by Luis Majano
Modern Functional Fluent CFML REST by Luis MajanoModern Functional Fluent CFML REST by Luis Majano
Modern Functional Fluent CFML REST by Luis Majano
Ortus Solutions, Corp
 
BoxLang DNA - Feature: World-Class Support
BoxLang DNA - Feature: World-Class SupportBoxLang DNA - Feature: World-Class Support
BoxLang DNA - Feature: World-Class Support
Ortus Solutions, Corp
 
ITB 2023 cbq - Jobs And Tasks In the Background - Eric Peterson.pdf
ITB 2023 cbq - Jobs And Tasks In the Background - Eric Peterson.pdfITB 2023 cbq - Jobs And Tasks In the Background - Eric Peterson.pdf
ITB 2023 cbq - Jobs And Tasks In the Background - Eric Peterson.pdf
Ortus Solutions, Corp
 
ITB 2023 - cbElasticSearch Modern Searching for Modern CFML - Jon Clausen.pdf
ITB 2023 - cbElasticSearch Modern Searching for Modern CFML - Jon Clausen.pdfITB 2023 - cbElasticSearch Modern Searching for Modern CFML - Jon Clausen.pdf
ITB 2023 - cbElasticSearch Modern Searching for Modern CFML - Jon Clausen.pdf
Ortus Solutions, Corp
 
ITB 2023 Modernizing the App A tale from the trenches- David Paul Belanger.pdf
ITB 2023 Modernizing the App A tale from the trenches- David Paul Belanger.pdfITB 2023 Modernizing the App A tale from the trenches- David Paul Belanger.pdf
ITB 2023 Modernizing the App A tale from the trenches- David Paul Belanger.pdf
Ortus Solutions, Corp
 
ITB 2023 Creating and managing a QA focused production-replicating environmen...
ITB 2023 Creating and managing a QA focused production-replicating environmen...ITB 2023 Creating and managing a QA focused production-replicating environmen...
ITB 2023 Creating and managing a QA focused production-replicating environmen...
Ortus Solutions, Corp
 
ITB 2023 10 Techniques for writing easy yet stupidly thorough unit tests_Dan ...
ITB 2023 10 Techniques for writing easy yet stupidly thorough unit tests_Dan ...ITB 2023 10 Techniques for writing easy yet stupidly thorough unit tests_Dan ...
ITB 2023 10 Techniques for writing easy yet stupidly thorough unit tests_Dan ...
Ortus Solutions, Corp
 
ITB 2023 Headless eCommerce with CFML - Jon Clausen.pdf
ITB 2023 Headless eCommerce with CFML - Jon Clausen.pdfITB 2023 Headless eCommerce with CFML - Jon Clausen.pdf
ITB 2023 Headless eCommerce with CFML - Jon Clausen.pdf
Ortus Solutions, Corp
 
Crash Course in CSS Grid plus FlexBox - Nolan Erck
Crash Course in CSS Grid plus FlexBox - Nolan ErckCrash Course in CSS Grid plus FlexBox - Nolan Erck
Crash Course in CSS Grid plus FlexBox - Nolan Erck
Ortus Solutions, Corp
 
ITB 2023 - 800 Pounds Gorilla - a Design session for no designers - Jona Lain...
ITB 2023 - 800 Pounds Gorilla - a Design session for no designers - Jona Lain...ITB 2023 - 800 Pounds Gorilla - a Design session for no designers - Jona Lain...
ITB 2023 - 800 Pounds Gorilla - a Design session for no designers - Jona Lain...
Ortus Solutions, Corp
 
ITB 2023 - The Many Layers of OAuth - Keith Casey .pdf
ITB 2023 - The Many Layers of OAuth - Keith Casey .pdfITB 2023 - The Many Layers of OAuth - Keith Casey .pdf
ITB 2023 - The Many Layers of OAuth - Keith Casey .pdf
Ortus Solutions, Corp
 
ITB 2023 - Chatgpt Box! AI All The Things - Scott Steinbeck.pdf
ITB 2023 - Chatgpt Box! AI All The Things - Scott Steinbeck.pdfITB 2023 - Chatgpt Box! AI All The Things - Scott Steinbeck.pdf
ITB 2023 - Chatgpt Box! AI All The Things - Scott Steinbeck.pdf
Ortus Solutions, Corp
 
ITB 2023 Build Vue Apps Using tdd (Test-Driven Development).pptx
ITB 2023 Build Vue Apps Using tdd (Test-Driven Development).pptxITB 2023 Build Vue Apps Using tdd (Test-Driven Development).pptx
ITB 2023 Build Vue Apps Using tdd (Test-Driven Development).pptx
Ortus Solutions, Corp
 
ITB 2023 - Create as many web sites or web apps as you want - George Murphy.pdf
ITB 2023 - Create as many web sites or web apps as you want - George Murphy.pdfITB 2023 - Create as many web sites or web apps as you want - George Murphy.pdf
ITB 2023 - Create as many web sites or web apps as you want - George Murphy.pdf
Ortus Solutions, Corp
 
ITB 2023 qb, Migration, Seeders. Recipe For Success - Gavin-Pickin.pdf
ITB 2023 qb, Migration, Seeders. Recipe For Success - Gavin-Pickin.pdfITB 2023 qb, Migration, Seeders. Recipe For Success - Gavin-Pickin.pdf
ITB 2023 qb, Migration, Seeders. Recipe For Success - Gavin-Pickin.pdf
Ortus Solutions, Corp
 
Ad

Recently uploaded (20)

Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Eric D. Schabell
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
ssuserb14185
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
Maxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINKMaxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINK
younisnoman75
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
Mastering OOP: Understanding the Four Core Pillars
Mastering OOP: Understanding the Four Core PillarsMastering OOP: Understanding the Four Core Pillars
Mastering OOP: Understanding the Four Core Pillars
Marcel David
 
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Dele Amefo
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
Xforce Keygen 64-bit AutoCAD 2025 Crack
Xforce Keygen 64-bit AutoCAD 2025  CrackXforce Keygen 64-bit AutoCAD 2025  Crack
Xforce Keygen 64-bit AutoCAD 2025 Crack
usmanhidray
 
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
Egor Kaleynik
 
Minitab 22 Full Crack Plus Product Key Free Download [Latest] 2025
Minitab 22 Full Crack Plus Product Key Free Download [Latest] 2025Minitab 22 Full Crack Plus Product Key Free Download [Latest] 2025
Minitab 22 Full Crack Plus Product Key Free Download [Latest] 2025
wareshashahzadiii
 
Adobe Photoshop CC 2025 Crack Full Serial Key With Latest
Adobe Photoshop CC 2025 Crack Full Serial Key  With LatestAdobe Photoshop CC 2025 Crack Full Serial Key  With Latest
Adobe Photoshop CC 2025 Crack Full Serial Key With Latest
usmanhidray
 
EASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License CodeEASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License Code
aneelaramzan63
 
Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Eric D. Schabell
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
ssuserb14185
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
Maxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINKMaxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINK
younisnoman75
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
Mastering OOP: Understanding the Four Core Pillars
Mastering OOP: Understanding the Four Core PillarsMastering OOP: Understanding the Four Core Pillars
Mastering OOP: Understanding the Four Core Pillars
Marcel David
 
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Dele Amefo
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
Xforce Keygen 64-bit AutoCAD 2025 Crack
Xforce Keygen 64-bit AutoCAD 2025  CrackXforce Keygen 64-bit AutoCAD 2025  Crack
Xforce Keygen 64-bit AutoCAD 2025 Crack
usmanhidray
 
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
Egor Kaleynik
 
Minitab 22 Full Crack Plus Product Key Free Download [Latest] 2025
Minitab 22 Full Crack Plus Product Key Free Download [Latest] 2025Minitab 22 Full Crack Plus Product Key Free Download [Latest] 2025
Minitab 22 Full Crack Plus Product Key Free Download [Latest] 2025
wareshashahzadiii
 
Adobe Photoshop CC 2025 Crack Full Serial Key With Latest
Adobe Photoshop CC 2025 Crack Full Serial Key  With LatestAdobe Photoshop CC 2025 Crack Full Serial Key  With Latest
Adobe Photoshop CC 2025 Crack Full Serial Key With Latest
usmanhidray
 
EASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License CodeEASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License Code
aneelaramzan63
 
Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
Ad

ITB 2023 cbPlaywright End-to-end Tests with Playwright and TestBox - Eric Petersen.pdf

  • 3. What this talk is An overview of cbPlaywright An overview of Playwright Java How to use the companion CommandBox library A few end-to-end testing selector strategies Live coding cbPlaywright tests
  • 4. What this talk isn't About unit, integration, or any other kind of testing besides end-to-end (or browser) tests Comparison to other end-to-end testing tools Deep dive into end-to-end testing best practices
  • 7. Includes the necessary jars and drivers to run Playwright Java Provides integration with TestBox and ColdBox tests Helper methods for making interacting with Playwright Java easier What is cbPlaywright?
  • 10. If Playwright Java exists...why would I use cbPlaywright?
  • 11. Includes the necessary jars to run Playwright Java
  • 12. Companion CommandBox module for downloading the correct platform drivers
  • 13. Helper functions to turn this.... var screenshotOptions = createObject( "java", "com.microsoft.playwright.Page$ScreenshotOptions" ).init(); var screenshotPath = createObject( "java", "java.nio.file.Paths" ).get( javacast( "String", expandPath( "/tests/results/screenshotOne.png" ) ), javacast( "String[]", [] ) ); screenshotOptions.setPath( screenshotPath ); page.screenshot( screenshotOptions ); 1 2 3 4 5 6 ...into this screenshotPage( page, "/tests/results/screenshotOne.png" ); 1
  • 16. Unfortunately, there is more this time....
  • 17. There's this thing called a driver.... Running the driver from the Playwright Java jars was finicky The driver-bundle jar is very large (about 200 MB unzipped) The driver-bundle included versions for all the platforms You ended up downloading a full driver-bundle for every cbPlaywright installation. Interacting with the driver CLI was a pain
  • 19. CommandBox cbPlaywright Installs as a dependency of cbPlaywright Manages installing the correct driver for your platform Automatically downloads a driver on install Provides a passthrough to the Playwright CLI # Install the Playwright driver cbplaywright driver install # Install Chromium as a test browser playwright install chromium 1 2 3 4 5
  • 21. // tests/Application.cfc component { this.javaSettings = { loadPaths: directoryList( rootPath & "modules/cbPlaywright/lib", true, "array", "*jar" ), loadColdFusionClassPath: true, reloadOnChange: false }; } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Add the Jar Paths
  • 22. // tests/Application.cfc component { this.mappings[ "/cbPlaywright" ] = rootPath & "/modules/cbPlaywright"; } 1 2 3 4 5 6 Create a Mapping
  • 24. Usage
  • 26. component extends="cbPlaywright.models.PlaywrightTestCase" { function run() { // ... } } 1 2 3 4 5 6 7 Extend the Playwright Test Case component extends="cbPlaywright.models.ColdBoxPlaywrightTestCase" { function run() { // ... } } 1 2 3 4 5 6 7
  • 27. component extends="cbPlaywright.models.PlaywrightTestCase" { function run() { describe( "Playwright Tests", () => { it( "can visit the Google homepage", () => { var browser = launchBrowser( variables.playwright.chromium() ); var page = browser.newPage(); navigate( page, "https://google.com" ); waitForLoadState( page ); expect( page.title() ).toBe( "Google" ); } ); } ); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Visit a Page
  • 28. component extends="cbPlaywright.models.PlaywrightTestCase" { function run() { describe( "Playwright Tests", () => { it( "can visit the Google homepage", () => { var browser = launchBrowser( variables.playwright.chromium() ); var page = browser.newPage(); navigate( page, "https://google.com" ); waitForLoadState( page ); expect( page.title() ).toBe( "Google" ); } ); } ); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 var browser = launchBrowser( variables.playwright.chromium() ); component extends="cbPlaywright.models.PlaywrightTestCase" { 1 2 function run() { 3 describe( "Playwright Tests", () => { 4 it( "can visit the Google homepage", () => { 5 6 var page = browser.newPage(); 7 navigate( page, "https://google.com" ); 8 waitForLoadState( page ); 9 expect( page.title() ).toBe( "Google" ); 10 } ); 11 } ); 12 } 13 14 } 15 Visit a Page
  • 29. component extends="cbPlaywright.models.PlaywrightTestCase" { function run() { describe( "Playwright Tests", () => { it( "can visit the Google homepage", () => { var browser = launchBrowser( variables.playwright.chromium() ); var page = browser.newPage(); navigate( page, "https://google.com" ); waitForLoadState( page ); expect( page.title() ).toBe( "Google" ); } ); } ); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 var browser = launchBrowser( variables.playwright.chromium() ); component extends="cbPlaywright.models.PlaywrightTestCase" { 1 2 function run() { 3 describe( "Playwright Tests", () => { 4 it( "can visit the Google homepage", () => { 5 6 var page = browser.newPage(); 7 navigate( page, "https://google.com" ); 8 waitForLoadState( page ); 9 expect( page.title() ).toBe( "Google" ); 10 } ); 11 } ); 12 } 13 14 } 15 var page = browser.newPage(); component extends="cbPlaywright.models.PlaywrightTestCase" { 1 2 function run() { 3 describe( "Playwright Tests", () => { 4 it( "can visit the Google homepage", () => { 5 var browser = launchBrowser( variables.playwright.chromium() ); 6 7 navigate( page, "https://google.com" ); 8 waitForLoadState( page ); 9 expect( page.title() ).toBe( "Google" ); 10 } ); 11 } ); 12 } 13 14 } 15 Visit a Page
  • 30. component extends="cbPlaywright.models.PlaywrightTestCase" { function run() { describe( "Playwright Tests", () => { it( "can visit the Google homepage", () => { var browser = launchBrowser( variables.playwright.chromium() ); var page = browser.newPage(); navigate( page, "https://google.com" ); waitForLoadState( page ); expect( page.title() ).toBe( "Google" ); } ); } ); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 var browser = launchBrowser( variables.playwright.chromium() ); component extends="cbPlaywright.models.PlaywrightTestCase" { 1 2 function run() { 3 describe( "Playwright Tests", () => { 4 it( "can visit the Google homepage", () => { 5 6 var page = browser.newPage(); 7 navigate( page, "https://google.com" ); 8 waitForLoadState( page ); 9 expect( page.title() ).toBe( "Google" ); 10 } ); 11 } ); 12 } 13 14 } 15 var page = browser.newPage(); component extends="cbPlaywright.models.PlaywrightTestCase" { 1 2 function run() { 3 describe( "Playwright Tests", () => { 4 it( "can visit the Google homepage", () => { 5 var browser = launchBrowser( variables.playwright.chromium() ); 6 7 navigate( page, "https://google.com" ); 8 waitForLoadState( page ); 9 expect( page.title() ).toBe( "Google" ); 10 } ); 11 } ); 12 } 13 14 } 15 navigate( page, "https://google.com" ); waitForLoadState( page ); component extends="cbPlaywright.models.PlaywrightTestCase" { 1 2 function run() { 3 describe( "Playwright Tests", () => { 4 it( "can visit the Google homepage", () => { 5 var browser = launchBrowser( variables.playwright.chromium() ); 6 var page = browser.newPage(); 7 8 9 expect( page.title() ).toBe( "Google" ); 10 } ); 11 } ); 12 } 13 14 } 15 Visit a Page
  • 31. component extends="cbPlaywright.models.PlaywrightTestCase" { function run() { describe( "Playwright Tests", () => { it( "can visit the Google homepage", () => { var browser = launchBrowser( variables.playwright.chromium() ); var page = browser.newPage(); navigate( page, "https://google.com" ); waitForLoadState( page ); expect( page.title() ).toBe( "Google" ); } ); } ); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 var browser = launchBrowser( variables.playwright.chromium() ); component extends="cbPlaywright.models.PlaywrightTestCase" { 1 2 function run() { 3 describe( "Playwright Tests", () => { 4 it( "can visit the Google homepage", () => { 5 6 var page = browser.newPage(); 7 navigate( page, "https://google.com" ); 8 waitForLoadState( page ); 9 expect( page.title() ).toBe( "Google" ); 10 } ); 11 } ); 12 } 13 14 } 15 var page = browser.newPage(); component extends="cbPlaywright.models.PlaywrightTestCase" { 1 2 function run() { 3 describe( "Playwright Tests", () => { 4 it( "can visit the Google homepage", () => { 5 var browser = launchBrowser( variables.playwright.chromium() ); 6 7 navigate( page, "https://google.com" ); 8 waitForLoadState( page ); 9 expect( page.title() ).toBe( "Google" ); 10 } ); 11 } ); 12 } 13 14 } 15 navigate( page, "https://google.com" ); waitForLoadState( page ); component extends="cbPlaywright.models.PlaywrightTestCase" { 1 2 function run() { 3 describe( "Playwright Tests", () => { 4 it( "can visit the Google homepage", () => { 5 var browser = launchBrowser( variables.playwright.chromium() ); 6 var page = browser.newPage(); 7 8 9 expect( page.title() ).toBe( "Google" ); 10 } ); 11 } ); 12 } 13 14 } 15 expect( page.title() ).toBe( "Google" ); component extends="cbPlaywright.models.PlaywrightTestCase" { 1 2 function run() { 3 describe( "Playwright Tests", () => { 4 it( "can visit the Google homepage", () => { 5 var browser = launchBrowser( variables.playwright.chromium() ); 6 var page = browser.newPage(); 7 navigate( page, "https://google.com" ); 8 waitForLoadState( page ); 9 10 } ); 11 } ); 12 } 13 14 } 15 Visit a Page
  • 32. component extends="cbPlaywright.models.PlaywrightTestCase" { function run() { describe( "Playwright Tests", () => { it( "can perform a search on Google", () => { var browser = launchBrowser( variables.playwright.chromium() ); var page = browser.newPage(); navigate( page, "https://google.com" ); waitForLoadState( page ); var searchBox = locateElement( page, '[aria-label="Search"]' ); fill( searchBox, "playwright" ); press( searchBox, "Enter" ); expect( page.url() ).toInclude( "https://www.google.com/search?q=playwright" ); } ); } ); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Fill Out a Form
  • 33. component extends="cbPlaywright.models.PlaywrightTestCase" { function run() { describe( "Playwright Tests", () => { it( "can perform a search on Google", () => { var browser = launchBrowser( variables.playwright.chromium() ); var page = browser.newPage(); navigate( page, "https://google.com" ); waitForLoadState( page ); var searchBox = locateElement( page, '[aria-label="Search"]' ); fill( searchBox, "playwright" ); press( searchBox, "Enter" ); expect( page.url() ).toInclude( "https://www.google.com/search?q=playwright" ); } ); } ); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 var searchBox = locateElement( page, '[aria-label="Search"]' ); fill( searchBox, "playwright" ); press( searchBox, "Enter" ); expect( page.url() ).toInclude( "https://www.google.com/search?q=playwright" ); component extends="cbPlaywright.models.PlaywrightTestCase" { 1 2 function run() { 3 describe( "Playwright Tests", () => { 4 it( "can perform a search on Google", () => { 5 var browser = launchBrowser( variables.playwright.chromium() ); 6 var page = browser.newPage(); 7 navigate( page, "https://google.com" ); 8 waitForLoadState( page ); 9 10 11 12 13 14 15 } ); 16 } ); 17 } 18 19 } 20 Fill Out a Form
  • 34. What makes a good Selector?
  • 35. Role Label Text Placeholder Text Text Display Value What makes a good Selector? https://testing-library.com/docs/queries/about 1. Queries Accessible to Everyone 2. Semantic Queries 3. Test IDs Alt Text Title
  • 36. component extends="cbPlaywright.models.PlaywrightTestCase" { function run() { describe( "Playwright Tests", () => { it( "can visit the Google homepage", () => { var browser = launchBrowser( variables.playwright.chromium() ); var page = browser.newPage(); navigate( page, "https://google.com" ); waitForLoadState( page ); expect( page.title() ).toBe( "Google" ); screenshotPage( page, "/tests/results/homepage.png" ); } ); } ); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Take a Screenshot
  • 37. component extends="cbPlaywright.models.PlaywrightTestCase" { function run() { describe( "Playwright Tests", () => { it( "can visit the Google homepage", () => { var browser = launchBrowser( variables.playwright.chromium() ); var page = browser.newPage(); navigate( page, "https://google.com" ); waitForLoadState( page ); expect( page.title() ).toBe( "Google" ); screenshotPage( page, "/tests/results/homepage.png" ); } ); } ); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 screenshotPage( page, "/tests/results/homepage.png" ); component extends="cbPlaywright.models.PlaywrightTestCase" { 1 2 function run() { 3 describe( "Playwright Tests", () => { 4 it( "can visit the Google homepage", () => { 5 var browser = launchBrowser( variables.playwright.chromium() ); 6 var page = browser.newPage(); 7 navigate( page, "https://google.com" ); 8 waitForLoadState( page ); 9 expect( page.title() ).toBe( "Google" ); 10 11 } ); 12 } ); 13 } 14 15 } 16 Take a Screenshot
  • 38. component extends="cbPlaywright.models.PlaywrightTestCase" { function run() { describe( "Playwright Tests", () => { it( "fill out the search form and click a link", () => { var browser = launchBrowser( variables.playwright.chromium() ); newRecordedContextForBrowser( browser, "/tests/results/videos", ( context ) => { var page = context.newPage(); navigate( page, "https://google.com" ); waitForLoadState( page ); var searchBox = locateElement( page, '[aria-label="Search"]' ); fill( searchBox, "playwright" ); press( searchBox, "Enter" ); expect( page.url() ).toInclude( "https://www.google.com/search?q=playwright" ); click( locateElement( page, "text=Playwright: Fast and reliable end-to-end testing for modern ..." ) ); waitForUrl( page, "https://playwright.dev/" ); } ); } ); } ); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Record a Video
  • 39. component extends="cbPlaywright.models.PlaywrightTestCase" { function run() { describe( "Playwright Tests", () => { it( "fill out the search form and click a link", () => { var browser = launchBrowser( variables.playwright.chromium() ); newRecordedContextForBrowser( browser, "/tests/results/videos", ( context ) => { var page = context.newPage(); navigate( page, "https://google.com" ); waitForLoadState( page ); var searchBox = locateElement( page, '[aria-label="Search"]' ); fill( searchBox, "playwright" ); press( searchBox, "Enter" ); expect( page.url() ).toInclude( "https://www.google.com/search?q=playwright" ); click( locateElement( page, "text=Playwright: Fast and reliable end-to-end testing for modern ..." ) ); waitForUrl( page, "https://playwright.dev/" ); } ); } ); } ); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 newRecordedContextForBrowser( browser, "/tests/results/videos", ( context ) => { } ); component extends="cbPlaywright.models.PlaywrightTestCase" { 1 2 function run() { 3 describe( "Playwright Tests", () => { 4 it( "fill out the search form and click a link", () => { 5 var browser = launchBrowser( variables.playwright.chromium() ); 6 7 var page = context.newPage(); 8 navigate( page, "https://google.com" ); 9 waitForLoadState( page ); 10 11 var searchBox = locateElement( page, '[aria-label="Search"]' ); 12 fill( searchBox, "playwright" ); 13 press( searchBox, "Enter" ); 14 15 expect( page.url() ).toInclude( "https://www.google.com/search?q=playwright" ); 16 17 click( 18 locateElement( 19 page, 20 "text=Playwright: Fast and reliable end-to-end testing for modern ..." 21 ) 22 ); 23 24 waitForUrl( page, "https://playwright.dev/" ); 25 26 } ); 27 } ); 28 } 29 30 } 31 Record a Video
  • 40. component extends="cbPlaywright.models.PlaywrightTestCase" { function run() { describe( "Playwright Tests", () => { it( "fill out the search form and click a link", () => { var browser = launchBrowser( variables.playwright.chromium() ); newRecordedContextForBrowser( browser, "/tests/results/videos", ( context ) => { var page = context.newPage(); navigate( page, "https://google.com" ); waitForLoadState( page ); var searchBox = locateElement( page, '[aria-label="Search"]' ); fill( searchBox, "playwright" ); press( searchBox, "Enter" ); expect( page.url() ).toInclude( "https://www.google.com/search?q=playwright" ); click( locateElement( page, "text=Playwright: Fast and reliable end-to-end testing for modern ..." ) ); waitForUrl( page, "https://playwright.dev/" ); } ); } ); } ); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 newRecordedContextForBrowser( browser, "/tests/results/videos", ( context ) => { } ); component extends="cbPlaywright.models.PlaywrightTestCase" { 1 2 function run() { 3 describe( "Playwright Tests", () => { 4 it( "fill out the search form and click a link", () => { 5 var browser = launchBrowser( variables.playwright.chromium() ); 6 7 var page = context.newPage(); 8 navigate( page, "https://google.com" ); 9 waitForLoadState( page ); 10 11 var searchBox = locateElement( page, '[aria-label="Search"]' ); 12 fill( searchBox, "playwright" ); 13 press( searchBox, "Enter" ); 14 15 expect( page.url() ).toInclude( "https://www.google.com/search?q=playwright" ); 16 17 click( 18 locateElement( 19 page, 20 "text=Playwright: Fast and reliable end-to-end testing for modern ..." 21 ) 22 ); 23 24 waitForUrl( page, "https://playwright.dev/" ); 25 26 } ); 27 } ); 28 } 29 30 } 31 newRecordedContextForBrowser( browser, "/tests/results/videos", ( context ) => { var page = context.newPage(); } ); component extends="cbPlaywright.models.PlaywrightTestCase" { 1 2 function run() { 3 describe( "Playwright Tests", () => { 4 it( "fill out the search form and click a link", () => { 5 var browser = launchBrowser( variables.playwright.chromium() ); 6 7 8 navigate( page, "https://google.com" ); 9 waitForLoadState( page ); 10 11 var searchBox = locateElement( page, '[aria-label="Search"]' ); 12 fill( searchBox, "playwright" ); 13 press( searchBox, "Enter" ); 14 15 expect( page.url() ).toInclude( "https://www.google.com/search?q=playwright" ); 16 17 click( 18 locateElement( 19 page, 20 "text=Playwright: Fast and reliable end-to-end testing for modern ..." 21 ) 22 ); 23 24 waitForUrl( page, "https://playwright.dev/" ); 25 26 } ); 27 } ); 28 } 29 30 } 31 Record a Video
  • 41. component extends="cbPlaywright.models.PlaywrightTestCase" { function run() { describe( "Playwright Tests", () => { it( "fill out the search form and click a link", () => { var browser = launchBrowser( variables.playwright.chromium() ); var context = browser.newContext(); traceContext( context, "/tests/results/trace.zip", function() { var page = context.newPage(); navigate( page, "https://google.com" ); waitForLoadState( page ); var searchBox = locateElement( page, '[aria-label="Search"]' ); fill( searchBox, "playwright" ); press( searchBox, "Enter" ); expect( page.url() ).toInclude( "https://www.google.com/search?q=playwright" ); click( locateElement( page, "text=Playwright: Fast and reliable end-to-end testing for modern ..." ) ); waitForUrl( page, "https://playwright.dev/" ); } ); } ); } ); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Save a Trace
  • 42. component extends="cbPlaywright.models.PlaywrightTestCase" { function run() { describe( "Playwright Tests", () => { it( "fill out the search form and click a link", () => { var browser = launchBrowser( variables.playwright.chromium() ); var context = browser.newContext(); traceContext( context, "/tests/results/trace.zip", function() { var page = context.newPage(); navigate( page, "https://google.com" ); waitForLoadState( page ); var searchBox = locateElement( page, '[aria-label="Search"]' ); fill( searchBox, "playwright" ); press( searchBox, "Enter" ); expect( page.url() ).toInclude( "https://www.google.com/search?q=playwright" ); click( locateElement( page, "text=Playwright: Fast and reliable end-to-end testing for modern ..." ) ); waitForUrl( page, "https://playwright.dev/" ); } ); } ); } ); } } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 var page = context.newPage(); } ); component extends="cbPlaywright.models.PlaywrightTestCase" { 1 function run() { 2 describe( "Playwright Tests", () => { 3 it( "fill out the search form and click a link", () => { 4 var browser = launchBrowser( variables.playwright.chromium() ); 5 var context = browser.newContext(); 6 traceContext( context, "/tests/results/trace.zip", function() { 7 8 navigate( page, "https://google.com" ); 9 waitForLoadState( page ); 10 11 var searchBox = locateElement( page, '[aria-label="Search"]' ); 12 fill( searchBox, "playwright" ); 13 press( searchBox, "Enter" ); 14 15 expect( page.url() ).toInclude( "https://www.google.com/search?q=playwright" ); 16 17 click( 18 locateElement( 19 page, 20 "text=Playwright: Fast and reliable end-to-end testing for modern ..." 21 ) 22 ); 23 24 waitForUrl( page, "https://playwright.dev/" ); 25 } ); 26 27 } ); 28 } 29 } 30 Save a Trace
  • 44. Demo
  • 45. Bonus
  • 46. name: PRs and Branches on: - push jobs: tests: runs-on: ubuntu-latest name: Tests steps: - name: Checkout Repository uses: actions/checkout@v2 - name: Setup Java JDK uses: actions/[email protected] with: java-version: 11 - name: Set Up CommandBox uses: elpete/[email protected] - name: Install dependencies run: box install - name: Start server run: box server start - name: Install Playwright dependencies run: | box playwright-cli install-deps box playwright-cli install chromium - name: Run TestBox Tests run: box testbox run 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 GitHub Actions
  • 47. name: PRs and Branches on: - push jobs: tests: runs-on: ubuntu-latest name: Tests steps: - name: Checkout Repository uses: actions/checkout@v2 - name: Setup Java JDK uses: actions/[email protected] with: java-version: 11 - name: Set Up CommandBox uses: elpete/[email protected] - name: Install dependencies run: box install - name: Start server run: box server start - name: Install Playwright dependencies run: | box playwright-cli install-deps box playwright-cli install chromium - name: Run TestBox Tests run: box testbox run 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 - name: Checkout Repository name: PRs and Branches 1 2 on: 3 - push 4 5 jobs: 6 tests: 7 runs-on: ubuntu-latest 8 name: Tests 9 steps: 10 11 uses: actions/checkout@v2 12 13 - name: Setup Java JDK 14 uses: actions/[email protected] 15 with: 16 java-version: 11 17 18 - name: Set Up CommandBox 19 uses: elpete/[email protected] 20 21 - name: Install dependencies 22 run: box install 23 24 - name: Start server 25 run: box server start 26 27 - name: Install Playwright dependencies 28 run: | 29 box playwright-cli install-deps 30 box playwright-cli install chromium 31 32 - name: Run TestBox Tests 33 run: box testbox run 34 GitHub Actions