From c2fe0ef9d295b55346fac04ac6b5a3a5423d71fc Mon Sep 17 00:00:00 2001 From: Jacek Norbert Date: Fri, 2 Aug 2019 12:19:53 +0200 Subject: [PATCH] e2e credentials --- Jenkinsfile | 5 ++- .../environment/environment.js | 17 ++-------- .../platform_portal_integration/smokeTests.js | 33 ++++++++++--------- 3 files changed, 23 insertions(+), 32 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 07a9d50..13533c8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -37,7 +37,10 @@ pipeline { } when { anyOf { branch 'master' } } steps { - withCredentials([usernamePassword(credentialsId: 'gmail-qa-user', usernameVariable: 'GOOGLE_EMAIL', passwordVariable: 'GOOGLE_PASSWORD')]) { + withCredentials([ + usernamePassword(credentialsId: 'gmail-qa-user', usernameVariable: 'GOOGLE_EMAIL', passwordVariable: 'GOOGLE_PASSWORD'), + usernamePassword(credentialsId: 'pp-uat-user', usernameVariable: 'USER_NAME_PP', passwordVariable: 'USER_PASS_PP') + ]){ sh 'npm run test-ci' } } diff --git a/tests/e2e/platform_portal_integration/environment/environment.js b/tests/e2e/platform_portal_integration/environment/environment.js index 9dc2441..32670d2 100644 --- a/tests/e2e/platform_portal_integration/environment/environment.js +++ b/tests/e2e/platform_portal_integration/environment/environment.js @@ -1,17 +1,4 @@ export const BASE_URL = process.env.BASE_URL || "https://partners.platform-os.com"; -export const ADMIN_PASS = process.env.ADMIN_PASS_GUI || "pass123sanity"; -export const USERDATA = process.env.DATA_GUI || { - NAME: "test_user", - LASTNAME: "qa", - USER_EMAIL: `test+${+new Date()}@example.com`, - PASSWORD: "password" -}; -export const PARTNERDATA = process.env.DATA_GUI || { - NAME: `partner+${+new Date()}` -}; -export const MODULEDATA = process.env.DATA_GUI || { - MODULENAME: `module+${+new Date()}` -}; - -export const EMAIL_USER_PROD = "jacek+ppe2e@near-me.com"; \ No newline at end of file +export const USER_NAME = process.env.USER_NAME_PP +export const USER_PASS = process.env.USER_PASS_PP \ No newline at end of file diff --git a/tests/e2e/platform_portal_integration/smokeTests.js b/tests/e2e/platform_portal_integration/smokeTests.js index a1fa94b..e10ed0c 100644 --- a/tests/e2e/platform_portal_integration/smokeTests.js +++ b/tests/e2e/platform_portal_integration/smokeTests.js @@ -1,15 +1,15 @@ import 'testcafe'; import { BASE_URL, - EMAIL_USER_PROD, - ADMIN_PASS, -} from './environment/environment'; -import LoginPage from './page-objects/loginPage'; -import Notifications from './page-objects/notifications'; -import Navigation from './page-objects/navigation'; -import InstancePage from './page-objects/instancePage'; -import BasePage from './page-objects/basePage'; -import ModulePage from './page-objects/modulePage'; + USER_NAME, + USER_PASS, +} from '../environment/environment'; +import LoginPage from '../page-objects/loginPage'; +import Notifications from '../page-objects/notifications'; +import Navigation from '../page-objects/navigation'; +import InstancePage from '../page-objects/instancePage'; +import BasePage from '../page-objects/basePage'; +import ModulePage from '../page-objects/modulePage'; const loginPage = new LoginPage(); const notifications = new Notifications(); @@ -18,13 +18,14 @@ const instancePage = new InstancePage(); const basePage = new BasePage(); const modulePage = new ModulePage(); -const admin_pass = ADMIN_PASS; +const user_name = USER_NAME; +const user_pass = USER_PASS; const instanceName = `test+${+new Date ()}`; fixture `pOS - PP - POS-CLI integration tests`.page(BASE_URL); test('Should let you create instance', async t => { - await loginPage.login(EMAIL_USER_PROD, admin_pass); + await loginPage.login(user_name, user_pass); await t .click(navigation.link.instances) .click(instancePage.button.newInstance); @@ -42,7 +43,7 @@ test('Should let you create instance', async t => { }); test('Should install blog module', async t => { - await loginPage.login(EMAIL_USER_PROD, admin_pass); + await loginPage.login(user_name, user_pass); await basePage.openPage(modulePage.installUAT_blogModule); await t .click(modulePage.button.addModuleToInstance) @@ -57,7 +58,7 @@ test('Should install blog module', async t => { }); test('Blog module should be installed on the page', async t => { - await loginPage.login(EMAIL_USER_PROD, admin_pass); + await loginPage.login(user_name, user_pass); await t .wait(30000) //waiting for module deploy .click(navigation.link.instances) @@ -68,7 +69,7 @@ test('Blog module should be installed on the page', async t => { }); test('Should let you remove instance', async t => { - await loginPage.login(EMAIL_USER_PROD, admin_pass); + await loginPage.login(user_name, user_pass); await t .click(instancePage.link.instanceName) .click(instancePage.link.dangerZone) @@ -78,9 +79,9 @@ test('Should let you remove instance', async t => { }); test('Instance should be removed', async t => { - await loginPage.login(EMAIL_USER_PROD, admin_pass); + await loginPage.login(user_name, user_pass); await t .click(navigation.link.instances) .expect(instancePage.link.instanceName.count) .eql(0); -}); +}); \ No newline at end of file