From a41029ba02414196b56ea205dff673acd2f9779e Mon Sep 17 00:00:00 2001 From: Maxim Musienko Date: Tue, 23 Jun 2020 10:35:27 +0300 Subject: [PATCH] Add parts for running Openshift plugin test nightly (#17112) * create openshift pugin test --- .../centos-ci/functional_tests_utils.sh | 2 +- .../nightly/cico-openshift-connector-test.sh | 63 +++++++++++++++++++ tests/e2e/TestConstants.ts | 4 +- tests/e2e/pageobjects/ide/OpenshiftPlugin.ts | 2 +- tests/e2e/pageobjects/ide/Terminal.ts | 20 ++++-- .../e2e/tests/e2e/OpenshiftConnector.spec.ts | 3 +- 6 files changed, 85 insertions(+), 9 deletions(-) create mode 100755 tests/.infra/centos-ci/nightly/cico-openshift-connector-test.sh diff --git a/tests/.infra/centos-ci/functional_tests_utils.sh b/tests/.infra/centos-ci/functional_tests_utils.sh index fc9477d24f..745c42f0ac 100755 --- a/tests/.infra/centos-ci/functional_tests_utils.sh +++ b/tests/.infra/centos-ci/functional_tests_utils.sh @@ -446,7 +446,7 @@ function runDevfileTestSuite() { -e TS_SELENIUM_LOAD_PAGE_TIMEOUT=240000 \ -e TS_SELENIUM_WORKSPACE_STATUS_POLLING=20000 \ -e NODE_TLS_REJECT_UNAUTHORIZED=0 \ - quay.io/eclipse/che-e2e:nightly || IS_TESTS_FAILED=true + maxura/e2e-tests:CHE-16927 || IS_TESTS_FAILED=true } function setupSelfSignedCertificate() { diff --git a/tests/.infra/centos-ci/nightly/cico-openshift-connector-test.sh b/tests/.infra/centos-ci/nightly/cico-openshift-connector-test.sh new file mode 100755 index 0000000000..996cc24c10 --- /dev/null +++ b/tests/.infra/centos-ci/nightly/cico-openshift-connector-test.sh @@ -0,0 +1,63 @@ +#!/usr/bin/env bash +# Copyright (c) 2018 Red Hat, Inc. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +set -x + +echo "========Starting nigtly test job $(date)========" + +source tests/.infra/centos-ci/functional_tests_utils.sh + +function runOpenshiftConnectorTest(){ + + ### Create directory for report + cd /root/payload + mkdir report + REPORT_FOLDER=$(pwd)/report + ### Run tests + docker run --net=host --ipc=host -v $REPORT_FOLDER:/tmp/e2e/report:Z -p 5920:5920 \ + -e TS_SELENIUM_HEADLESS=true \ + -e TS_SELENIUM_LOAD_PAGE_TIMEOUT=420000 \ + -e TS_SELENIUM_WORKSPACE_STATUS_POLLING=20000 \ + -e TS_SELENIUM_BASE_URL="https://$CHE_ROUTE" \ + -e TS_SELENIUM_LOG_LEVEL=DEBUG \ + -e TS_SELENIUM_USERNAME=${TEST_USERNAME} \ + -e TS_SELENIUM_PASSWORD=${TEST_USERNAME} \ + -e TS_TEST_OPENSHIFT_PLUGIN_USERNAME=developer \ + -e TS_TEST_OPENSHIFT_PLUGIN_PASSWORD=pass \ + -e TS_TEST_OPENSHIFT_PLUGIN_PROJECT=default \ + -e TS_SELENIUM_MULTIUSER=true \ + -e DELETE_WORKSPACE_ON_FAILED_TEST=true \ + -e TEST_SUITE=test-openshift-connector \ + -e NODE_TLS_REJECT_UNAUTHORIZED=0 \ + quay.io/eclipse/che-e2e:nightly || IS_TESTS_FAILED=true + +} + + +function prepareCustomResourcePatchFile() { + cat > /tmp/custom-resource-patch.yaml < { + const terminalText: string = await this.driverHelper.waitAndGetText(By.xpath(Terminal.TERMINAL_ROWS_XPATH_LOCATOR_PREFFIX + `[${terminalIndex}]`), timeout); + return terminalText.includes(expectedText); + + }, timeout); } async waitText(terminalTab: string, expectedText: string, timeout: number = TestConstants.TS_SELENIUM_DEFAULT_TIMEOUT) { diff --git a/tests/e2e/tests/e2e/OpenshiftConnector.spec.ts b/tests/e2e/tests/e2e/OpenshiftConnector.spec.ts index 5db1a4abdb..dceaf9cd1c 100644 --- a/tests/e2e/tests/e2e/OpenshiftConnector.spec.ts +++ b/tests/e2e/tests/e2e/OpenshiftConnector.spec.ts @@ -90,6 +90,7 @@ suite('Openshift connector user story', async () => { await quickOpenContainer.clickOnContainerItem('$(plus) Add new user...'); await quickOpenContainer.typeAndSelectSuggestion(TestConstants.TS_TEST_OPENSHIFT_PLUGIN_USERNAME, `Provide Username ${provideAuthenticationSuffix}`); await quickOpenContainer.typeAndSelectSuggestion(TestConstants.TS_TEST_OPENSHIFT_PLUGIN_PASSWORD, `Provide Password ${provideAuthenticationSuffix}`); + await openshiftPlugin.waitItemInTree(TestConstants.TS_TEST_OPENSHIFT_PLUGIN_PROJECT); }); test('Create new component with application', async () => { @@ -116,7 +117,7 @@ suite('Openshift connector user story', async () => { await quickOpenContainer.clickOnContainerItem(TestConstants.TS_TEST_OPENSHIFT_PLUGIN_PROJECT); await quickOpenContainer.clickOnContainerItem('node-js-app'); await quickOpenContainer.clickOnContainerItem('component-node-js'); - await terminal.waitText('OpenShift', 'Changes successfully pushed to component', TestConstants.TS_SELENIUM_LOAD_PAGE_TIMEOUT); + await terminal.selectTabByPrefixAndWaitText('OpenShift: Push', 'Changes successfully pushed to component', TestConstants.TS_SELENIUM_LOAD_PAGE_TIMEOUT); }); });