Skip to content

Commit 08c5218

Browse files
committed
wait for selector in waitForServerReady (wildfly), add commons (copilot)
1 parent 025ba69 commit 08c5218

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

scripts/pit/its/hello.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@ const { log, args, createPage, closePage, takeScreenshot, waitForServerReady, di
55

66
const page = await createPage(arg.headless);
77

8-
await waitForServerReady(page, arg.url);
8+
// Wait for server and vaadin ready
9+
await waitForServerReady(page, arg.url, {selector: '#outlet > * > *:not(style):not(script)'});
910

1011
// Dismiss dev mode notification if present
1112
await dismissDevmode(page);
1213

1314
const text = 'Greet';
1415

15-
// Wait for vaadin ready
16-
await page.waitForSelector('#outlet > * > *:not(style):not(script)');
17-
1816
await takeScreenshot(page, __filename, 'initial-view');
1917

2018
// Click input[type="text"]

scripts/pit/its/test-utils.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,18 +173,22 @@ function getCallingTestFile() {
173173
// Wait for the server to be ready and to get a valid response
174174
async function waitForServerReady(page, url, options = {}) {
175175
const {
176+
selector,
176177
maxRetries = 35, // Max number of retries
177178
retryInterval = 5000 // Interval between retries in milliseconds
178179
} = options;
179-
180180
log(`Opening ${url}\n`);
181181
for (let attempt = 0; attempt < maxRetries; attempt++) {
182182
await page.goto('about:blank');
183183
try {
184184
const response = await page.goto(url, {timeout: 5000});
185185
// Check if the response status is not 503
186186
if (response && response.status() < 400) {
187-
await page.waitForTimeout(1000);
187+
if (options.selector) {
188+
await page.waitForSelector(selector, {timeout: 1000});
189+
} else {
190+
await page.waitForTimeout(1000);
191+
}
188192
ok(` ✓ Attempt ${attempt} Server is ready and returned a valid response. ${response.status()}\n`);
189193
await takeScreenshot(page, getCallingTestFile(), 'ss', '_before');
190194
return response;

scripts/pit/lib/lib-patch-v25.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ applyv25patches() {
5959
## TODO: check that documentation mention elemental is not a transitive dep anymore
6060
addMavenDep "com.google.gwt" "gwt-elemental" compile '\<version\>2.9.0\</version\>'
6161
;;
62+
flow-quickstart-tutorial)
63+
addMavenDep "commons-io" "commons-io" "compile"
64+
addGradleDep "commons-io" "commons-io"
65+
;;
6266
esac
6367

6468
case $vers_ in
@@ -514,6 +518,7 @@ replaceVaadinSpringWithStarter() {
514518
fi
515519
}
516520

521+
517522
## Adds vaadin-dev dependency for projects without Spring
518523
## Checks if Spring is not present in build files and adds vaadin-dev dependency
519524
## TODO: verify that is explained in migration guide
@@ -542,6 +547,8 @@ addDevModeIfNeeded() {
542547
fi
543548
}
544549

550+
551+
545552
## Adds Hilla Spring Boot Starter dependency if project uses Hilla
546553
## Checks for Java files with Hilla imports or TypeScript files in views directories
547554
## TODO: verify that is explained in migration guide
@@ -626,3 +633,4 @@ addGradleDep() {
626633

627634

628635

636+

0 commit comments

Comments
 (0)