Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Commit

Permalink
Merge branch 'master' of https://github.com/fabric8-ui/fabric8-planner
Browse files Browse the repository at this point in the history
…into board-components
  • Loading branch information
sahil143 committed Jul 23, 2018
2 parents 59f1a85 + 15bcc7f commit 9b7f48a
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
6 changes: 3 additions & 3 deletions cico_test_prod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 16 additions & 1 deletion src/tests/page_objects/app.page.ts
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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();
}
}
5 changes: 4 additions & 1 deletion src/tests/specs/smoke/smokeTest.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 4 additions & 0 deletions src/tests/ui/planner/workitem-quickpreview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 9b7f48a

Please sign in to comment.