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

Move DevConsole integration tests to the appropriate package #3195

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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions frontend/integration-tests/protractor.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,6 @@ const testSuites = {
]),
clusterSettings: suite(['tests/cluster-settings.scenario.ts']),
login: ['tests/login.scenario.ts'],
// TODO(vojtech): move to dev-console package, with suite() mapper applied automatically
devconsole: [
'tests/devconsole/dev-perspective.scenario.ts',
'tests/devconsole/git-import-flow.scenario.ts',
],
};

export const config: Config = {
Expand Down
4 changes: 4 additions & 0 deletions frontend/packages/dev-console/integration-tests/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: ['plugin:console/node-typescript-prettier'],
};
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import { browser } from 'protractor';
import { appHost, checkLogs, checkErrors } from '../../protractor.conf';
import {
appHost,
checkLogs,
checkErrors,
} from '@console/internal-integration-tests/protractor.conf';
import {
switchPerspective,
Perspective,
pageSidebar,
sideHeader,
} from '../../views/devconsole-view/dev-perspective.view';
} from '../views/dev-perspective.view';

describe('Application Launcher Menu', () => {
beforeAll(async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { browser, $, ExpectedConditions as until } from 'protractor';
import { appHost, checkLogs, checkErrors } from '../../protractor.conf';
import {
appHost,
checkLogs,
checkErrors,
} from '@console/internal-integration-tests/protractor.conf';
import {
navigateImportFromGit,
setBuilderImage,
Expand All @@ -11,13 +15,9 @@ import {
buildImageVersion,
createButton,
builderImageVersionName,
} from '../../views/devconsole-view/git-imort-flow';
import { newApplicationName, newAppName } from '../../views/devconsole-view/new-app-name.view';
import {
switchPerspective,
Perspective,
sideHeader,
} from '../../views/devconsole-view/dev-perspective.view';
} from '../views/git-import-flow.view';
import { newApplicationName, newAppName } from '../views/new-app-name.view';
import { switchPerspective, Perspective, sideHeader } from '../views/dev-perspective.view';

describe('git import flow', () => {
let newApplication;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console, promise/catch-or-return */
import { ElementFinder, browser, ExpectedConditions as until, by, element, Key } from 'protractor';

export const addNavigate = element(by.css('[data-test-id="+Add-header"]'));
Expand Down Expand Up @@ -39,9 +40,9 @@ export const safeSendKeys = async function(
uiElementName: string,
newValue: string,
) {
/* Note on the use of the SenKeys Protractor function: There is a widely reported
/* Note on the use of the SendKeys Protractor function: There is a widely reported
bug in SendKeys where the function randomly drops characters. Most of the
workrounds for this bug involve sending individual chacaters one-by-one,
workarounds for this bug involve sending individual characters one-by-one,
separated by calls to browser.sleep() or calls to Browser.executeScript
to bypass the Protractor API. In our testing, we found neither of these approaches
to be acceptable as we do not want to introduce sleep statements and calls to
Expand All @@ -60,6 +61,7 @@ export const safeSendKeys = async function(
console.info('sendKeys failed for ', uiElementName, ' - retry', insertedValue, newValue);
await uiElement.sendKeys('text was', Key.chord(Key.CONTROL, 'a'), newValue);

// eslint-disable-next-line promise/no-nesting
uiElement.getAttribute('value').then(async function(insertedValue2) {
if (insertedValue2 !== newValue) {
console.info(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { info } from 'console';
/* eslint-disable no-console */

export const newApplicationName = function(): string {
const d = new Date();
Expand All @@ -7,8 +7,8 @@ export const newApplicationName = function(): string {
const hour = d.getHours() < 10 ? `0${d.getHours()}` : `${d.getHours()}`;
const minute = d.getMinutes() < 10 ? `0${d.getMinutes()}` : `${d.getMinutes()}`;
const randomNumber = Math.round(Math.random() * 10000);
const appName: string = `testapp-${month}${day}-${hour}${minute}-${randomNumber}`;
info('New application name', appName);
const appName = `testapp-${month}${day}-${hour}${minute}-${randomNumber}`;
console.info('New application name', appName);
return appName;
};

Expand All @@ -19,7 +19,7 @@ export const newAppName = function(): string {
const hour = d.getHours() < 10 ? `0${d.getHours()}` : `${d.getHours()}`;
const minute = d.getMinutes() < 10 ? `0${d.getMinutes()}` : `${d.getMinutes()}`;
const randomNumber = Math.round(Math.random() * 10000);
const nodeName: string = `app-${month}${day}-${hour}${minute}-${randomNumber}`;
info('New app name', nodeName);
const nodeName = `app-${month}${day}-${hour}${minute}-${randomNumber}`;
console.info('New app name', nodeName);
return nodeName;
};
8 changes: 7 additions & 1 deletion frontend/packages/dev-console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@
"version": "0.0.0-fixed",
"description": "OpenShift Developer Perspective",
"private": true,
"scripts": {
"lint": "yarn --cwd ../.. eslint packages/dev-console"
},
"dependencies": {
"@console/knative-plugin": "0.0.0-fixed",
"@console/plugin-sdk": "0.0.0-fixed",
"@console/topology": "0.0.0-fixed"
},
"consolePlugin": {
"entry": "src/plugin.tsx"
"entry": "src/plugin.tsx",
"integrationTestSuites": {
"devconsole": ["integration-tests/**/*.scenario.ts"]
}
}
}