Skip to content

Commit

Permalink
more reliable upload await
Browse files Browse the repository at this point in the history
  • Loading branch information
manolo committed Jan 29, 2025
1 parent b667af6 commit 5b1b021
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions scripts/pit/its/cc-install-apps.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { expect} = require('@playwright/test');
const fs = require('fs');
const {log, args, createPage, closePage, takeScreenshot, waitForServerReady, run} = require('./test-utils');
const {log, args, run, createPage, closePage, takeScreenshot, waitForServerReady} = require('./test-utils');

const arg = args();
let count = 0;
Expand All @@ -22,22 +22,25 @@ async function installApp(app, page) {
await page.getByLabel('Image', {exact: true}).fill(`k8sdemos/${app}:latest`)
await page.getByLabel('Application URI', {exact: true}).locator('input[type="text"]').fill(uri)
if (cert) {
log(`Uploading certificate ${cert} for ${app} ...\n`);
log(`Uploading certificate ${cert} for ${app}...\n`);
await page.getByLabel('Upload').click();
const fileChooserPromise = page.waitForEvent('filechooser');
await page.getByText('Browse').click();
const fileChooser = await fileChooserPromise;
await fileChooser.setFiles(cert);
fileChooserPromise.then(await page.locator('.detail-layout').getByRole('button', {name: 'Deploy'}).click())
await takeScreenshot(page, __filename, `form-filled-${app}`);
await page.locator('.detail-layout').getByRole('button', {name: 'Deploy'}).click();
} else {
log(`No certificate found for ${app}...\n`);
log(`No certificate found for ${app}\n`);
run(`pwd`);
run(`ls -l`);
await page.getByLabel('Generate').click();
await takeScreenshot(page, __filename, `form-filled-${app}`);
await page.locator('.detail-layout').getByRole('button', {name: 'Deploy'}).click();
}

await takeScreenshot(page, __filename, `form-filled-${app}`);
await takeScreenshot(page, __filename, `form-clicked-${app}`);

await page.getByRole('listitem').filter({ hasText: 'Settings'}).click()

Expand Down

0 comments on commit 5b1b021

Please sign in to comment.