[Selenium] Add DevWorkspaceHappyPath e2e typescript test (#19152)
parent
98e80b2981
commit
fa8b05a5d8
|
|
@ -223,6 +223,11 @@ export const TestConstants = {
|
|||
/**
|
||||
* Print all timeout variables when tests launch, defaulte to false
|
||||
*/
|
||||
TS_SELENIUM_PRINT_TIMEOUT_VARIABLES: process.env.TS_SELENIUM_PRINT_TIMEOUT_VARIABLES || false
|
||||
TS_SELENIUM_PRINT_TIMEOUT_VARIABLES: process.env.TS_SELENIUM_PRINT_TIMEOUT_VARIABLES || false,
|
||||
|
||||
/**
|
||||
* URL of the workspace created by devworkspace-controller
|
||||
*/
|
||||
TS_SELENIUM_DEVWORKSPACE_URL: process.env.TS_SELENIUM_DEVWORKSPACE_URL
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
--timeout 2200000
|
||||
--reporter 'dist/driver/CheReporter.js'
|
||||
-u tdd
|
||||
--bail
|
||||
--full-trace
|
||||
--spec dist/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.js
|
||||
--require source-map-support/register
|
||||
|
|
@ -10,6 +10,7 @@
|
|||
"test": "./generateIndex.sh && npm run lint && npm run tsc && mocha --opts mocha.opts",
|
||||
"load-test": "./generateIndex.sh && npm run lint && npm run tsc && mocha --opts mocha-load.opts",
|
||||
"test-happy-path": "./generateIndex.sh && npm run lint && npm run tsc && mocha --opts mocha-happy-path.opts",
|
||||
"test-devworkspace-happy-path": "./generateIndex.sh && npm run lint && npm run tsc && mocha --opts mocha-devworkspace-happy-path.opts",
|
||||
"test-wkspc-creation-and-ls": "./generateIndex.sh && npm run lint && npm run tsc && mocha --opts mocha-wkspc-creation-and-ls.opts",
|
||||
"test-java-vertx": "./generateIndex.sh && npm run lint && npm run tsc && mocha --opts mocha-java-vertx.opts",
|
||||
"test-git-ssh": "./generateIndex.sh && npm run lint && npm run tsc && mocha --opts mocha-git-ssh.opts",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
// /*********************************************************************
|
||||
// * Copyright (c) 2021 Red Hat, Inc.
|
||||
// *
|
||||
// * This program and the accompanying materials are made
|
||||
// * available under the terms of the Eclipse Public License 2.0
|
||||
// * which is available at https://www.eclipse.org/legal/epl-2.0/
|
||||
// *
|
||||
// * SPDX-License-Identifier: EPL-2.0
|
||||
// **********************************************************************/
|
||||
|
||||
import { e2eContainer } from '../../inversify.config';
|
||||
import { CLASSES } from '../../inversify.types';
|
||||
import { DriverHelper } from '../../utils/DriverHelper';
|
||||
import * as projectAndFileTests from '../../testsLibrary/ProjectAndFileTests';
|
||||
import { TestConstants } from '../..';
|
||||
|
||||
const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper);
|
||||
|
||||
// This test checks only workspace created from "web-nodejs-sample" https://github.com/devfile/devworkspace-operator/blob/main/samples/flattened_theia-next.yaml.
|
||||
suite('Workspace creation via factory url', async () => {
|
||||
|
||||
let factoryUrl : string = `${TestConstants.TS_SELENIUM_DEVWORKSPACE_URL}`;
|
||||
const workspaceSampleName: string = 'web-nodejs-sample';
|
||||
const workspaceRootFolderName: string = 'app';
|
||||
|
||||
suite('Open factory URL', async () => {
|
||||
test(`Navigating to factory URL`, async () => {
|
||||
await driverHelper.navigateToUrl(factoryUrl);
|
||||
});
|
||||
});
|
||||
|
||||
suite('Wait workspace readiness', async () => {
|
||||
projectAndFileTests.waitWorkspaceReadiness(workspaceSampleName, workspaceRootFolderName);
|
||||
});
|
||||
|
||||
});
|
||||
Loading…
Reference in New Issue