Disable control flow e2e ADF (#4954)

* update project script possible different JS-API

* first commit no controll flow

* second commit no controll flow

* third commit no controll flow

* 4 commit no controll flow

* 5 commit no controll flow

* 6 commit no controll flow

* 7 commit no controll flow

* 8 commit no controll flow

* 9 commit no controll flow

* 10 commit no controll flow

* 11 commit no controll flow

* 12 commit no controll flow

* 13 commit no controll flow

* 14 commit no controll flow

* 15 commit no controll flow

* 16 commit no controll flow

* 17 commit no controll flow

* 18 commit no controll flow

* 19 commit no controll flow

* 20 commit no controll flow

* remove wdpromise, protractor promise and deferred promises

* - fixed some incorrect “expect” calls
- fixed some matchers
- removed “return this;” when not needed
- added a few more await-s

* forgot a file

* fix some failing tests

* replaced driver calls with browser calls and enabled back waitForAngular

* fix rightClick methods and hopefully some tests

* fix settings-component

* some more fixes for core and content tests

* try to fix some more issues

* linting

* revert some changes, allowing download on headless chrome won’t work with multiple browser instances

* fixes for Search tests

* try to remove some wait calls

* fix build

* increase allScriptsTimeout and try another protractor and web driver version

* improve navigation methods

* some fixes for notification history and login sso

* forgot a space

* fix packages and enable some screenshots

* navigation bar fixes

* fix some test

* some fixes for notification history and navigation bar
use correct visibility method in attachFileWidget test

* fix searching and another fix for navigation

* try solve sso login

* some more fixes

* refactor async forEach into for..of

* try fix for search tests

* resolve rebabse problems

* remove install

* fix lint

* fix core e2e

* fix core e2e

* fix core e2e

* fix ps tests

* fix some tests

* fix core e2e

* fix core e2e

* fix core

* fix some issues PS

* fix core

* fix core

* fix some ps test

* fix rebase issues

* remove save

* fix url regressed after rebase

* fix url regressed after rebase

* fix ps and core

* fix lint

* more parallel e2e ps

* fix some ps cloud test

* some cloud fix

* fix lint

* fix some test

* remove files to be ignored

* out-tsc

* improve one cs test

* fix candidate base app

* fix ps test

* remove click function

* clean methods alrady present in browser action

* try ugly wait

* move wait

* remove duplicate call

* remove underscore

* fix after review

* fix imports

* minor cosmetic fixes

* fix comments test
This commit is contained in:
Eugenio Romano
2019-08-17 14:32:02 +02:00
committed by GitHub
parent 4f3cf669f2
commit 83412bb9b6
328 changed files with 17653 additions and 18793 deletions

View File

@@ -30,255 +30,241 @@ describe('CardView Component', () => {
const cardViewPageComponent = new CardViewComponentPage();
const metadataViewPage = new MetadataViewPage();
beforeAll(async (done) => {
loginPage.loginToContentServices(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
navigationBarPage.clickCardViewButton();
beforeAll(async () => {
await loginPage.loginToContentServices(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await navigationBarPage.clickCardViewButton();
done();
});
afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
afterEach(() => {
cardViewPageComponent.clickOnResetButton();
afterEach(async () => {
await cardViewPageComponent.clickOnResetButton();
});
describe('key-value pair ', () => {
it('[C279938] Should the label be present', () => {
it('[C279938] Should the label be present', async () => {
const label = element(by.css('div[data-automation-id="card-key-value-pairs-label-key-value-pairs"]'));
BrowserVisibility.waitUntilElementIsPresent(label);
await BrowserVisibility.waitUntilElementIsPresent(label);
});
it('[C279898] Should be possible edit key-value pair properties', () => {
cardViewPageComponent.clickOnAddButton();
cardViewPageComponent.setName('testName');
cardViewPageComponent.setValue('testValue');
cardViewPageComponent.clickOnAddButton();
cardViewPageComponent.waitForOutput();
expect(cardViewPageComponent.getOutputText(0)).toBe('[CardView Key-Value Pairs Item] - [{"name":"testName","value":"testValue"}]');
it('[C279898] Should be possible edit key-value pair properties', async () => {
await cardViewPageComponent.clickOnAddButton();
await cardViewPageComponent.setName('testName');
await cardViewPageComponent.setValue('testValue');
await cardViewPageComponent.clickOnAddButton();
await cardViewPageComponent.waitForOutput();
await expect(await cardViewPageComponent.getOutputText(0)).toBe('[CardView Key-Value Pairs Item] - [{"name":"testName","value":"testValue"}]');
cardViewPageComponent.deletePairsValues();
await cardViewPageComponent.deletePairsValues();
expect(cardViewPageComponent.getOutputText(1)).toBe('[CardView Key-Value Pairs Item] - []');
await expect(await cardViewPageComponent.getOutputText(1)).toBe('[CardView Key-Value Pairs Item] - []');
});
});
describe('SelectBox', () => {
it('[C279939] Should the label be present', () => {
it('[C279939] Should the label be present', async () => {
const label = element(by.css('div[data-automation-id="card-select-label-select"]'));
BrowserVisibility.waitUntilElementIsPresent(label);
await BrowserVisibility.waitUntilElementIsPresent(label);
});
it('[C279899] Should be possible edit selectBox item', () => {
cardViewPageComponent.clickSelectBox();
cardViewPageComponent.selectValueFromComboBox(1);
it('[C279899] Should be possible edit selectBox item', async () => {
await cardViewPageComponent.clickSelectBox();
await cardViewPageComponent.selectValueFromComboBox(1);
expect(cardViewPageComponent.getOutputText(0))
await expect(await cardViewPageComponent.getOutputText(0))
.toBe('[CardView Select Item] - two');
});
});
describe('Text', () => {
it('[C279937] Should the label be present', () => {
it('[C279937] Should the label be present', async () => {
const label = element(by.css('div[data-automation-id="card-textitem-label-name"]'));
BrowserVisibility.waitUntilElementIsPresent(label);
await BrowserVisibility.waitUntilElementIsPresent(label);
});
it('[C279943] Should be present a default value', () => {
expect(cardViewPageComponent.getTextFieldText()).toBe('Spock');
it('[C279943] Should be present a default value', async () => {
await expect(await cardViewPageComponent.getTextFieldText()).toBe('Spock');
});
it('[C279934] Should be possible edit text item', () => {
cardViewPageComponent
.clickOnTextField()
.enterTextField('example')
.clickOnTextSaveIcon();
it('[C279934] Should be possible edit text item', async () => {
await cardViewPageComponent.clickOnTextField();
await cardViewPageComponent.enterTextField('example');
await cardViewPageComponent.clickOnTextSaveIcon();
expect(cardViewPageComponent.getOutputText(0)).toBe('[CardView Text Item] - example');
await expect(await cardViewPageComponent.getOutputText(0)).toBe('[CardView Text Item] - example');
});
it('[C279944] Should be possible undo text item modify when click on the clear button', () => {
cardViewPageComponent
.clickOnTextField()
.enterTextField('example')
.clickOnTextClearIcon();
it('[C279944] Should be possible undo text item modify when click on the clear button', async () => {
await cardViewPageComponent.clickOnTextField();
await cardViewPageComponent.enterTextField('example');
await cardViewPageComponent.clickOnTextClearIcon();
expect(cardViewPageComponent.getTextFieldText()).toBe('Spock');
await expect(await cardViewPageComponent.getTextFieldText()).toBe('Spock');
});
});
describe('Int', () => {
it('[C279940] Should the label be present', () => {
it('[C279940] Should the label be present', async () => {
const label = element(by.css('div[data-automation-id="card-textitem-label-int"]'));
BrowserVisibility.waitUntilElementIsPresent(label);
await BrowserVisibility.waitUntilElementIsPresent(label);
});
it('[C279945] Should be present a default value', () => {
expect(cardViewPageComponent.getIntFieldText()).toBe('213');
it('[C279945] Should be present a default value', async () => {
await expect(await cardViewPageComponent.getIntFieldText()).toBe('213');
});
it('[C279946] Should be possible edit int item', () => {
cardViewPageComponent
.clickOnIntField()
.enterIntField('99999')
.clickOnIntSaveIcon();
it('[C279946] Should be possible edit int item', async () => {
await cardViewPageComponent.clickOnIntField();
await cardViewPageComponent.enterIntField('99999');
await cardViewPageComponent.clickOnIntSaveIcon();
expect(cardViewPageComponent.getOutputText(0)).toBe('[CardView Int Item] - 99999');
await expect(await cardViewPageComponent.getOutputText(0)).toBe('[CardView Int Item] - 99999');
});
it('[C279947] Should not be possible add string value to the int item', () => {
cardViewPageComponent
.clickOnIntField()
.enterIntField('string value')
.clickOnIntSaveIcon();
it('[C279947] Should not be possible add string value to the int item', async () => {
await cardViewPageComponent.clickOnIntField();
await cardViewPageComponent.enterIntField('string value');
await cardViewPageComponent.clickOnIntSaveIcon();
expect(cardViewPageComponent.getErrorInt()).toBe('Use an integer format');
await expect(await cardViewPageComponent.getErrorInt()).toBe('Use an integer format');
});
it('[C279948] Should not be possible add float value to the int item', () => {
cardViewPageComponent
.clickOnIntField()
.enterIntField('0.22')
.clickOnIntSaveIcon();
it('[C279948] Should not be possible add float value to the int item', async () => {
await cardViewPageComponent.clickOnIntField();
await cardViewPageComponent.enterIntField('0.22');
await cardViewPageComponent.clickOnIntSaveIcon();
expect(cardViewPageComponent.getErrorInt()).toBe('Use an integer format');
await expect(await cardViewPageComponent.getErrorInt()).toBe('Use an integer format');
});
it('[C279949] Should not be possible have an empty value', () => {
cardViewPageComponent
.clickOnIntField()
.enterIntField(' ')
.clickOnIntSaveIcon();
it('[C279949] Should not be possible have an empty value', async () => {
await cardViewPageComponent.clickOnIntField();
await cardViewPageComponent.enterIntField(' ');
await cardViewPageComponent.clickOnIntSaveIcon();
expect(cardViewPageComponent.getErrorInt()).toBe('Use an integer format');
await expect(await cardViewPageComponent.getErrorInt()).toBe('Use an integer format');
});
it('[C279950] Should return an error when the value is > 2147483647', () => {
cardViewPageComponent
.clickOnIntField()
.enterIntField('214748367')
.clickOnIntSaveIcon();
it('[C279950] Should return an error when the value is > 2147483647', async () => {
await cardViewPageComponent.clickOnIntField();
await cardViewPageComponent.enterIntField('214748367');
await cardViewPageComponent.clickOnIntSaveIcon();
expect(cardViewPageComponent.getOutputText(0)).toBe('[CardView Int Item] - 214748367');
await expect(await cardViewPageComponent.getOutputText(0)).toBe('[CardView Int Item] - 214748367');
cardViewPageComponent
.clickOnIntField()
.enterIntField('2147483648')
.clickOnIntSaveIcon();
await cardViewPageComponent.clickOnIntField();
await cardViewPageComponent.enterIntField('2147483648');
await cardViewPageComponent.clickOnIntSaveIcon();
expect(cardViewPageComponent.getErrorInt()).toBe('Use an integer format');
await expect(await cardViewPageComponent.getErrorInt()).toBe('Use an integer format');
});
it('[C279951] Should be possible undo item modify when click on the clear button', () => {
cardViewPageComponent
.clickOnIntField()
.enterIntField('999')
.clickOnIntClearIcon();
it('[C279951] Should be possible undo item modify when click on the clear button', async () => {
await cardViewPageComponent.clickOnIntField();
await cardViewPageComponent.enterIntField('999');
await cardViewPageComponent.clickOnIntClearIcon();
expect(cardViewPageComponent.getIntFieldText()).toBe('213');
await expect(await cardViewPageComponent.getIntFieldText()).toBe('213');
});
});
describe('Float', () => {
it('[C279941] Should the label be present', () => {
it('[C279941] Should the label be present', async () => {
const label = element(by.css('div[data-automation-id="card-textitem-label-float"]'));
BrowserVisibility.waitUntilElementIsPresent(label);
await BrowserVisibility.waitUntilElementIsPresent(label);
});
it('[C279952] Should be present a default value', () => {
expect(cardViewPageComponent.getFloatFieldText()).toBe('9.9');
it('[C279952] Should be present a default value', async () => {
await expect(await cardViewPageComponent.getFloatFieldText()).toBe('9.9');
});
it('[C279953] Should be possible edit float item', () => {
cardViewPageComponent
.clickOnFloatField()
.enterFloatField('77.33')
.clickOnFloatSaveIcon();
it('[C279953] Should be possible edit float item', async () => {
await cardViewPageComponent.clickOnFloatField();
await cardViewPageComponent.enterFloatField('77.33');
await cardViewPageComponent.clickOnFloatSaveIcon();
expect(cardViewPageComponent.getOutputText(0)).toBe('[CardView Float Item] - 77.33');
await expect(await cardViewPageComponent.getOutputText(0)).toBe('[CardView Float Item] - 77.33');
});
it('[C279954] Should not be possible add string value to the float item', () => {
cardViewPageComponent
.clickOnFloatField()
.enterFloatField('string value')
.clickOnFloatSaveIcon();
it('[C279954] Should not be possible add string value to the float item', async () => {
await cardViewPageComponent.clickOnFloatField();
await cardViewPageComponent.enterFloatField('string value');
await cardViewPageComponent.clickOnFloatSaveIcon();
expect(cardViewPageComponent.getErrorFloat()).toBe('Use a number format');
await expect(await cardViewPageComponent.getErrorFloat()).toBe('Use a number format');
});
it('[C279955] Should be possible undo item item modify when click on the clear button', () => {
cardViewPageComponent
.clickOnFloatField()
.enterFloatField('77.33')
.clickOnFloatClearIcon();
it('[C279955] Should be possible undo item item modify when click on the clear button', async () => {
await cardViewPageComponent.clickOnFloatField();
await cardViewPageComponent.enterFloatField('77.33');
await cardViewPageComponent.clickOnFloatClearIcon();
expect(cardViewPageComponent.getFloatFieldText()).toBe('9.9');
await expect(await cardViewPageComponent.getFloatFieldText()).toBe('9.9');
});
it('[C279956] Should not be possible have an empty value', () => {
cardViewPageComponent
.clickOnFloatField()
.enterFloatField(' ')
.clickOnFloatSaveIcon();
it('[C279956] Should not be possible have an empty value', async () => {
await cardViewPageComponent.clickOnFloatField();
await cardViewPageComponent.enterFloatField(' ');
await cardViewPageComponent.clickOnFloatSaveIcon();
expect(cardViewPageComponent.getErrorFloat()).toBe('Use a number format');
await expect(await cardViewPageComponent.getErrorFloat()).toBe('Use a number format');
});
});
describe('Boolean', () => {
it('[C279942] Should the label be present', () => {
it('[C279942] Should the label be present', async () => {
const label = element(by.css('div[data-automation-id="card-boolean-label-boolean"]'));
BrowserVisibility.waitUntilElementIsPresent(label);
await BrowserVisibility.waitUntilElementIsPresent(label);
});
it('[C279957] Should be possible edit the checkbox value when click on it', () => {
cardViewPageComponent.checkboxClick();
it('[C279957] Should be possible edit the checkbox value when click on it', async () => {
await cardViewPageComponent.checkboxClick();
expect(cardViewPageComponent.getOutputText(0)).toBe('[CardView Boolean Item] - false');
await expect(await cardViewPageComponent.getOutputText(0)).toBe('[CardView Boolean Item] - false');
cardViewPageComponent.checkboxClick();
await cardViewPageComponent.checkboxClick();
expect(cardViewPageComponent.getOutputText(1)).toBe('[CardView Boolean Item] - true');
await expect(await cardViewPageComponent.getOutputText(1)).toBe('[CardView Boolean Item] - true');
});
});
describe('Date and DateTime', () => {
it('[C279961] Should the label be present', () => {
it('[C279961] Should the label be present', async () => {
const labelDate = element(by.css('div[data-automation-id="card-dateitem-label-date"]'));
BrowserVisibility.waitUntilElementIsPresent(labelDate);
await BrowserVisibility.waitUntilElementIsPresent(labelDate);
const labelDatetime = element(by.css('div[data-automation-id="card-dateitem-label-datetime"]'));
BrowserVisibility.waitUntilElementIsPresent(labelDatetime);
await BrowserVisibility.waitUntilElementIsPresent(labelDatetime);
});
it('[C279962] Should be present a default value', () => {
expect(metadataViewPage.getPropertyText('date', 'date')).toEqual('12/24/83');
expect(metadataViewPage.getPropertyText('datetime', 'datetime')).toEqual('Dec 24, 1983, 10:00');
it('[C279962] Should be present a default value', async () => {
await expect(await metadataViewPage.getPropertyText('date', 'date')).toEqual('12/24/83');
await expect(await metadataViewPage.getPropertyText('datetime', 'datetime')).toEqual('Dec 24, 1983, 10:00');
});
});
it('[C279936] Should not be possible edit any parameter when editable property is false', () => {
cardViewPageComponent.disableEdit();
it('[C279936] Should not be possible edit any parameter when editable property is false', async () => {
await cardViewPageComponent.disableEdit();
const editIconText = element(by.css('mat-icon[data-automation-id="card-textitem-edit-icon-name"]'));
const editIconInt = element(by.css('mat-icon[data-automation-id="card-textitem-edit-icon-int"]'));
@@ -286,10 +272,10 @@ describe('CardView Component', () => {
const editIconKey = element(by.css('mat-icon[data-automation-id="card-key-value-pairs-button-key-value-pairs"]'));
const editIconData = element(by.css('mat-datetimepicker-toggle'));
BrowserVisibility.waitUntilElementIsNotVisible(editIconText);
BrowserVisibility.waitUntilElementIsNotVisible(editIconInt);
BrowserVisibility.waitUntilElementIsNotVisible(editIconFloat);
BrowserVisibility.waitUntilElementIsNotVisible(editIconKey);
BrowserVisibility.waitUntilElementIsNotVisible(editIconData);
await BrowserVisibility.waitUntilElementIsNotVisible(editIconText);
await BrowserVisibility.waitUntilElementIsNotVisible(editIconInt);
await BrowserVisibility.waitUntilElementIsNotVisible(editIconFloat);
await BrowserVisibility.waitUntilElementIsNotVisible(editIconKey);
await BrowserVisibility.waitUntilElementIsNotVisible(editIconData);
});
});