Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1839996: fix VM Environment integration tests #5557

Merged
merged 1 commit into from May 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1,6 +1,6 @@
import { getSecret, getConfigMap, getServiceAccount } from './utils/mocks';
import { createResource, deleteResource, click } from '@console/shared/src/test-utils/utils';
import { browser, ExpectedConditions as until, Key, element, by } from 'protractor';
import { browser, ExpectedConditions as until, Key } from 'protractor';
import { createExampleVMViaYAML } from './utils/utils';
import { testName } from '@console/internal-integration-tests/protractor.conf';
import { isLoaded } from '@console/internal-integration-tests/views/crud.view';
Expand Down Expand Up @@ -50,10 +50,7 @@ describe('Test VM enviromnet tab', () => {
await vmEnv.addSource(secretName);

// Add Service Account
await click(
element(by.buttonText('Add Config Map, Secret or Service Account')),
PAGE_LOAD_TIMEOUT_SECS,
);
await click(vmEnv.addVariableButton, PAGE_LOAD_TIMEOUT_SECS);
await addVariableFrom(serviceAccountName, null, true);
await browser.wait(until.presenceOf(vmEnv.successAlert));
expect(vmEnv.successAlert.isDisplayed()).toEqual(true);
Expand All @@ -80,8 +77,6 @@ describe('Test VM enviromnet tab', () => {
it('ID(CNV-4186) Error when resource has no serial', async () => {
await vmEnv.serialField.get(1).clear();
await vmEnv.serialField.get(1).sendKeys('i', Key.BACK_SPACE); // workaround: for some reason clear() is not enough
await browser.wait(until.elementToBeClickable(vmEnv.saveBtn), PAGE_LOAD_TIMEOUT_SECS);
await click(vmEnv.saveBtn, PAGE_LOAD_TIMEOUT_SECS);
await browser.wait(until.presenceOf(vmEnv.errorAlert), PAGE_LOAD_TIMEOUT_SECS);
const errorText = await vmEnv.errorAlert.getText();
expect(vmEnv.errorAlert.isDisplayed()).toEqual(true);
Expand All @@ -92,19 +87,14 @@ describe('Test VM enviromnet tab', () => {
const firstSerial = await vmEnv.serialField.get(0).getAttribute('value');
await vmEnv.serialField.get(1).clear();
await vmEnv.serialField.get(1).sendKeys(firstSerial);
await browser.wait(until.elementToBeClickable(vmEnv.saveBtn), PAGE_LOAD_TIMEOUT_SECS);
await click(vmEnv.saveBtn, PAGE_LOAD_TIMEOUT_SECS);
await browser.wait(until.presenceOf(vmEnv.errorAlert), PAGE_LOAD_TIMEOUT_SECS);
expect(vmEnv.errorAlert.isDisplayed()).toEqual(true);
const errorText = await vmEnv.errorAlert.getText();
expect(errorText).toContain(vmEnv.dupSerialsError);
});

it('ID(CNV-4188) Cannot use the same resource more than once', async () => {
await click(
element(by.buttonText('Add All From Config Map or Secret')),
PAGE_LOAD_TIMEOUT_SECS,
);
await click(vmEnv.addVariableButton, PAGE_LOAD_TIMEOUT_SECS);
await isLoaded();
await vmEnv.dropDownBtn
.filter(async (elem) => {
Expand Down
@@ -1,8 +1,7 @@
import { $, $$, browser, by, ExpectedConditions as until, element } from 'protractor';
import { addVariableFrom } from '@console/internal-integration-tests/views/environment.view';
import { PAGE_LOAD_TIMEOUT_SECS } from '../tests/utils/consts';

import { click } from '@console/shared/src/test-utils/utils';
import { PAGE_LOAD_TIMEOUT_SECS } from '../tests/utils/consts';

export const allPairRows = $$('.pairs-list__row');

Expand Down