diff --git a/cico_test_prod.sh b/cico_test_prod.sh index ec1715569..5e43f161d 100755 --- a/cico_test_prod.sh +++ b/cico_test_prod.sh @@ -9,9 +9,9 @@ set -e # Source environment variables of the jenkins slave # that might interest this worker -if [ -e "../jenkins-env" ]; then - cat ../jenkins-env \ - | grep -E "(JENKINS_URL|GIT_BRANCH|GIT_COMMIT|USER_NAME|PASSWORD|BUILD_NUMBER|REFRESH_TOKEN|ARTIFACT_PASS)=" \ +if [ -e "jenkins-env" ]; then + cat jenkins-env \ + | grep -E "^(JENKINS_URL|GIT_BRANCH|GIT_COMMIT|USER_NAME|PASSWORD|BUILD_NUMBER|REFRESH_TOKEN|ARTIFACT_PASS)=" \ | sed 's/^/export /g' \ > /tmp/jenkins-env source /tmp/jenkins-env diff --git a/src/tests/page_objects/app.page.ts b/src/tests/page_objects/app.page.ts index b2473615b..42cc79100 100644 --- a/src/tests/page_objects/app.page.ts +++ b/src/tests/page_objects/app.page.ts @@ -1,11 +1,15 @@ import { $, browser, by, ExpectedConditions as until } from 'protractor'; import * as support from '../support'; -import { BaseElement } from '../ui'; +import { BaseElement, Clickable } from '../ui'; import { BasePage } from './base.page'; export abstract class AppPage extends BasePage { appTag = $('f8-app'); + mainNavBar = new BaseElement($('header ul.navbar-primary.persistent-secondary'), 'Main Navigation Bar'); + planTab = new Clickable(this.mainNavBar.element(by.xpath("//span[text()='Plan']")), 'Plan Tab'); + backLogTab = new Clickable(this.mainNavBar.element(by.xpath("//span[text()=' Backlog ']")), 'Backlog Tab'); + boardTab = new Clickable(this.mainNavBar.element(by.xpath("//span[text()=' Board ']")), 'Board Tab'); /** * Extend this class, to describe Application Page(after logging in) @@ -34,4 +38,15 @@ export abstract class AppPage extends BasePage { await browser.wait(until.presenceOf(this.appTag)); } + async clickPlanTab() { + await this.planTab.clickWhenReady(); + } + + async clickBacklogTab() { + await this.backLogTab.clickWhenReady(); + } + + async clickBoardTab() { + await this.boardTab.clickWhenReady(); + } } diff --git a/src/tests/specs/smoke/smokeTest.spec.ts b/src/tests/specs/smoke/smokeTest.spec.ts index ec6844b66..e65de8274 100644 --- a/src/tests/specs/smoke/smokeTest.spec.ts +++ b/src/tests/specs/smoke/smokeTest.spec.ts @@ -60,13 +60,16 @@ describe('Planner Smoke Tests:', () => { }); it('Check WorkItem creator name and image is reflected', async () => { - let prodAvatar = 'https://avatars0.githubusercontent.com/u/563119?v=3&s=25'; + let prodAvatar = 'https://avatars0.githubusercontent.com/u/563119?v=3&s=25', + prodPreviewAvatar = 'https://www.gravatar.com/avatar/d77d23eebe9907842b8ad9f1d9905454.jpg&s=25'; await planner.workItemList.clickWorkItem(c.workItemTitle2); await planner.quickPreview.ready(); /* Run tests against production or prod-preview */ let url = await browser.getCurrentUrl(); if (url.startsWith('https://openshift.io')) { expect(await planner.quickPreview.getCreatorAvatar()).toBe(prodAvatar); + } else if (url.startsWith('https://prod-preview.openshift.io/')) { + expect(await planner.quickPreview.getCreatorAvatar()).toBe(prodPreviewAvatar); } else { expect(await planner.quickPreview.getCreatorAvatar()).toBe(c.user_avatar); } diff --git a/src/tests/ui/planner/workitem-quickpreview.ts b/src/tests/ui/planner/workitem-quickpreview.ts index 92047432a..49242143e 100644 --- a/src/tests/ui/planner/workitem-quickpreview.ts +++ b/src/tests/ui/planner/workitem-quickpreview.ts @@ -203,10 +203,14 @@ export class WorkItemQuickPreview extends ui.BaseElement { await this.linkTypeDropdown.clickWhenReady(); await this.linkTypeDropdown.select(link); await this.searchWorkItem.enterText(searchWorkItem); + // Needs further investigation, test throws Stale Element without sleep + await browser.sleep(2000); await this.workItemList.untilCount(1); await this.workItemDropdown.select(workItem); await this.linkButton.untilTextIsPresent('Link'); await this.linkButton.clickWhenReady(); + // Needs further investigation, test throws Stale Element without sleep + await browser.sleep(2000); } async removeLink(workItem: string) {