From 6ac3c9304efd76845884e95d134a3808f67c9291 Mon Sep 17 00:00:00 2001 From: alokhyland Date: Thu, 24 Oct 2024 16:55:34 +0530 Subject: [PATCH] added console 1 --- .../features/step_definitions/browser.js | 55 ++++++++++--------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/packages/nuxeo-web-ui-ftest/features/step_definitions/browser.js b/packages/nuxeo-web-ui-ftest/features/step_definitions/browser.js index ecd2c7c63f..2f475fac19 100644 --- a/packages/nuxeo-web-ui-ftest/features/step_definitions/browser.js +++ b/packages/nuxeo-web-ui-ftest/features/step_definitions/browser.js @@ -2,14 +2,14 @@ // eslint-disable-next-line import/no-extraneous-dependencies import { Then, When } from '@cucumber/cucumber'; -Then('I can see the {word} tree', async function(tab) { +Then('I can see the {word} tree', async function (tab) { const drawer = await this.ui.drawer; await drawer._section(tab); const isVisible = await drawer.waitForVisible(); isVisible.should.be.true; }); -Then('I can see the {string} {word} tree node', async function(title, tab) { +Then('I can see the {string} {word} tree node', async function (title, tab) { const drawer = await this.ui.drawer; const sectionTab = await drawer._section(tab); await sectionTab.waitForVisible(); @@ -25,7 +25,7 @@ Then('I can see the {string} {word} tree node', async function(title, tab) { throw new Error(`Expected text to be ${title} but not found`); }); -Then('I can navigate to {word} pill', async function(pill) { +Then('I can navigate to {word} pill', async function (pill) { await driver.pause(1000); const browser = await this.ui.browser; await browser.waitForVisible(); @@ -36,20 +36,20 @@ Then('I can navigate to {word} pill', async function(pill) { await driver.pause(1000); }); -Then('I cannot see to {word} pill', async function(pill) { +Then('I cannot see to {word} pill', async function (pill) { const browser = await this.ui.browser; await browser.waitForVisible(); const outElement = await browser.waitForNotVisible(`nuxeo-page-item[name='${pill.toLowerCase()}']`); outElement.should.be.true; }); -Then('I am on the {word} pill', async function(pill) { +Then('I am on the {word} pill', async function (pill) { await this.ui.browser.waitForVisible(); const currentPageEle = await this.ui.browser.currentPageName; currentPageEle.should.equal(pill); }); -When('I click {string} in the {word} tree', async function(title, tab) { +When('I click {string} in the {word} tree', async function (title, tab) { const drawer = await this.ui.drawer; const sectionTab = await drawer._section(tab); await sectionTab.waitForVisible(); @@ -73,45 +73,45 @@ When('I click {string} in the {word} tree', async function(title, tab) { } }); -Then('I can see the {string} document', async function(title) { +Then('I can see the {string} document', async function (title) { const browser = await this.ui.browser; await browser.waitForVisible(); const browserTitle = await browser.hasTitle(title); browserTitle.should.be.true; }); -Then('I select all child documents', async function() { +Then('I select all child documents', async function () { const browser = await this.ui.browser; await browser.waitForVisible(); await browser.selectAllChildDocuments(); }); -Then('I select all the documents', async function() { +Then('I select all the documents', async function () { const browser = await this.ui.browser; await browser.waitForVisible(); await browser.selectAllDocuments(); }); -Then('I deselect the {string} document', async function(title) { +Then('I deselect the {string} document', async function (title) { const browser = await this.ui.browser; await browser.waitForVisible(); await browser.deselectChildDocument(title); }); -Then('I select the {string} document', async function(title) { +Then('I select the {string} document', async function (title) { const browser = await this.ui.browser; await browser.waitForVisible(); await browser.selectChildDocument(title); }); -Then('I can see the selection toolbar', async function() { +Then('I can see the selection toolbar', async function () { const browser = await this.ui.browser; await browser.waitForVisible(); const toolbar = await browser.selectionToolbar; await toolbar.waitForVisible(); }); -When('I cannot see the display selection link', async function() { +When('I cannot see the display selection link', async function () { const browser = await this.ui.browser; await browser.waitForVisible(); const selectionToolbarElem = await browser.selectionToolbar; @@ -121,7 +121,7 @@ When('I cannot see the display selection link', async function() { selectionLinkVisible.should.be.true; }); -Then('I can add selection to the {string} collection', async function(collectionName) { +Then('I can add selection to the {string} collection', async function (collectionName) { const browserEle = await this.ui.browser; await browserEle.waitForVisible(); const selectionToolEle = await browserEle.selectionToolbar; @@ -129,28 +129,28 @@ Then('I can add selection to the {string} collection', async function(collection await addToDialog.addToCollection(collectionName); }); -Then('I can add selection to clipboard', async function() { +Then('I can add selection to clipboard', async function () { const browser = await this.ui.browser; await browser.waitForVisible(); const toolbar = await browser.selectionToolbar; await toolbar.addToClipboard(); }); -Then('I can move selection down', async function() { +Then('I can move selection down', async function () { const browser = await this.ui.browser; await browser.waitForVisible(); const selectionToolbar = await browser.selectionToolbar; await selectionToolbar.moveDown(); }); -Then('I can move selection up', async function() { +Then('I can move selection up', async function () { const browser = await this.ui.browser; await browser.waitForVisible(); const selectionToolbar = await browser.selectionToolbar; await selectionToolbar.moveUp(); }); -Then('I can see the {string} child document is at position {int}', async function(title, pos) { +Then('I can see the {string} child document is at position {int}', async function (title, pos) { await driver.pause(1000); const browser = await this.ui.browser; await browser.waitForVisible(); @@ -160,13 +160,13 @@ Then('I can see the {string} child document is at position {int}', async functio } }); -When('I sort the content by {string} in {string} order', async function(field, order) { +When('I sort the content by {string} in {string} order', async function (field, order) { const browser = await this.ui.browser; await browser.waitForVisible(); await browser.sortContent(field, order); }); -Then('I can see {int} document(s)', async function(numberOfResults) { +Then('I can see {int} document(s)', async function (numberOfResults) { const browser = await this.ui.browser; const uiResult = await browser.results; const displayMode = await uiResult.displayMode; @@ -176,11 +176,11 @@ Then('I can see {int} document(s)', async function(numberOfResults) { } }); -Then(/^I can see the permissions page$/, async function() { +Then(/^I can see the permissions page$/, async function () { await this.ui.browser.permissionsView.waitForVisible(); }); -Then(/^I can see the document has (\d+) publications$/, async function(nbPublications) { +Then(/^I can see the document has (\d+) publications$/, async function (nbPublications) { const browser = await this.ui.browser; const count = await browser.publicationView.count; if ((await count) !== nbPublications) { @@ -188,7 +188,7 @@ Then(/^I can see the document has (\d+) publications$/, async function(nbPublica } }); -Then(/^I can see the document has the following publication$/, async function(table) { +Then(/^I can see the document has the following publication$/, async function (table) { const rows = table.rows(); for (let i = 0; i < rows.length; i++) { const row = rows[i]; @@ -198,7 +198,7 @@ Then(/^I can see the document has the following publication$/, async function(ta } }); -Then(/^I can republish the following publication$/, async function(table) { +Then(/^I can republish the following publication$/, async function (table) { const rows = table.hashes(); for (let i = 0; i < rows.length; i++) { const { path, rendition, version } = rows[i]; @@ -221,7 +221,7 @@ Then(/^I can republish the following publication$/, async function(table) { } }); -Then('I can publish selection to {string}', async function(target) { +Then('I can publish selection to {string}', async function (target) { const browser = await this.ui.browser; await browser.waitForVisible(); const selectionToolBar = await browser.selectionToolbar; @@ -231,7 +231,8 @@ Then('I can publish selection to {string}', async function(target) { await driver.pause(1000); }); -Then(/^I can perform the following publications$/, async function(table) { +Then(/^I can perform the following publications$/, async function (table) { + console.log('tabletabletabletabletable', table) const browser = await this.ui.browser; await browser.waitForVisible(); const page = await browser.documentPage(this.doc.type); @@ -258,7 +259,7 @@ Then(/^I can perform the following publications$/, async function(table) { } }); -Then('I can delete all the documents from the {string} collection', async function(name) { +Then('I can delete all the documents from the {string} collection', async function (name) { const browser = await this.ui.browser; await browser.removeSelectionFromCollection(name); // HACK - because the delete all is async