Skip to content

Commit

Permalink
WEBUI-1393: Update Functional Test Feature: Upload
Browse files Browse the repository at this point in the history
  • Loading branch information
rahuljain-dev committed Dec 19, 2023
1 parent 24d8ea0 commit 4826811
Showing 1 changed file with 41 additions and 31 deletions.
72 changes: 41 additions & 31 deletions packages/nuxeo-web-ui-ftest/features/step_definitions/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,57 @@ import { Then } from '../../node_modules/@cucumber/cucumber';

Then(/^I upload file "(.+)" as document content/, async function(file) {
const element = await this.ui.browser.el.element('nuxeo-dropzone');
fixtures.layouts.setValue(element, file);
await fixtures.layouts.setValue(element, file);
});

Then('I can see the blob replace button', function() {
const page = this.ui.browser.documentPage(this.doc.type);
page.waitForVisible();
page.view.waitForVisible();
page.view.waitForVisible('nuxeo-replace-blob-button').should.be.true;
Then('I can see the blob replace button', async function() {
const page = await this.ui.browser.documentPage(this.doc.type);
await page.waitForVisible();
await page.view.waitForVisible();
const ele = await page.view.el.element('nuxeo-replace-blob-button');
const result = await ele.waitForVisible();
result.should.be.true;
});

Then("I can't see the blob replace button", function() {
const page = this.ui.browser.documentPage(this.doc.type);
page.waitForVisible();
page.view.waitForVisible();
page.view.el.element('nuxeo-replace-blob-button').waitForVisible(browser.options.waitforTimeout, true).should.be.true;
Then("I can't see the blob replace button", async function() {
const page = await this.ui.browser.documentPage(this.doc.type);
await page.waitForVisible();
await page.view.waitForVisible();
const ele = await page.view.el.element('nuxeo-replace-blob-button');
const result = await ele.waitForVisible(5000, true);
result.should.be.true;
});

Then('I can see the option to add new attachments', function() {
const page = this.ui.browser.documentPage(this.doc.type);
page.waitForVisible();
page.metadata.waitForVisible();
page.metadata.waitForVisible('nuxeo-dropzone').should.be.true;
Then('I can see the option to add new attachments', async function() {
const page = await this.ui.browser.documentPage(this.doc.type);
await page.waitForVisible();
await page.metadata.waitForVisible();
const ele = await page.metadata.el.element('nuxeo-dropzone');
const result = await ele.waitForVisible();
result.should.be.true;
});

Then("I can't see the option to add new attachments", function() {
const page = this.ui.browser.documentPage(this.doc.type);
page.waitForVisible();
page.metadata.waitForVisible();
page.metadata.waitForNotVisible('nuxeo-dropzone').should.be.true;
Then("I can't see the option to add new attachments", async function() {
const page = await this.ui.browser.documentPage(this.doc.type);
await page.waitForVisible();
await page.metadata.waitForVisible();
const result = await page.metadata.waitForNotVisible('nuxeo-dropzone');
result.should.be.true;
});

Then('I can see the option to add a main blob', function() {
const page = this.ui.browser.documentPage(this.doc.type);
page.waitForVisible();
page.view.waitForVisible();
page.view.waitForVisible('nuxeo-dropzone').should.be.true;
Then('I can see the option to add a main blob', async function() {
const page = await this.ui.browser.documentPage(this.doc.type);
await page.waitForVisible();
await page.view.waitForVisible();
const ele = await page.view.el.element('nuxeo-dropzone');
const result = await ele.waitForVisible();
result.should.be.true;
});

Then("I can't see the option to add a main blob", function() {
const page = this.ui.browser.documentPage(this.doc.type);
page.waitForVisible();
page.view.waitForVisible();
page.view.waitForNotVisible('nuxeo-dropzone').should.be.true;
Then("I can't see the option to add a main blob", async function() {
const page = await this.ui.browser.documentPage(this.doc.type);
await page.waitForVisible();
await page.view.waitForVisible();
const result = await page.view.waitForNotVisible('nuxeo-dropzone');
result.should.be.true;
});

0 comments on commit 4826811

Please sign in to comment.