Skip to content

Commit

Permalink
improve
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderegg committed Nov 1, 2023
1 parent e41af2e commit 25bb7d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions tests/e2e/utils/auto.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ async function dashboardOpenService(page, serviceName) {
const children = await utils.getVisibleChildrenIDs(page, '[osparc-test-id="servicesList"]');
if (children.length) {
let idx = 0;
for (let i=0; i<children.length; i++) {
for (let i = 0; i < children.length; i++) {
const childId = '[osparc-test-id="' + children[i] + '"]';
const cardLabel = await utils.getDashboardCardLabel(page, childId);
if (cardLabel === serviceName) {
Expand Down Expand Up @@ -227,7 +227,7 @@ async function __filterServicesByText(page, serviceName) {
}

async function __typeInSearchBarFilter(page, resource, text) {
const fieldSelector = '[osparc-test-id="searchBarFilter-textField-'+resource+'"]';
const fieldSelector = '[osparc-test-id="searchBarFilter-textField-' + resource + '"]';
await __typeInFilter(page, fieldSelector, text);
}

Expand All @@ -254,10 +254,12 @@ async function findLogMessage(page, text) {

await utils.waitAndClick(page, '[osparc-test-id="logsFilterField"]');
await utils.clearInput(page, '[osparc-test-id="logsFilterField"]');
await utils.takeScreenshot(page, 'findLogMessage_' + text + "_before");
await page.type('[osparc-test-id="logsFilterField"]', text);
await utils.sleep(2000);

const found1 = await page.evaluate((text) => window.find(text), text);
await utils.takeScreenshot(page, 'find_' + text);
await utils.takeScreenshot(page, 'findLogMessage_' + text + "_after");
return found1;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ function createScreenshotsDir() {

async function takeScreenshot(page, captureName = "") {
const event = new Date();
const time = event.toLocaleTimeString('de-CH');
const time = event.toLocaleTimeString('de-CH') + `.${event.getMilliseconds()}`;
let filename = time + "_" + captureName;
filename = filename.split(":").join("-")
filename = filename + ".jpg";
Expand Down

0 comments on commit 25bb7d6

Please sign in to comment.