From c01f98a5d2e45523a2aee684a55fc81e6df93139 Mon Sep 17 00:00:00 2001 From: Len DiMaggio Date: Fri, 3 Mar 2017 16:35:26 -0500 Subject: [PATCH] test: Updated tests to be in synch with UI changes - 9 tests are fialing due to issue: 1071 --- protractor.config.js | 2 +- .../work-item/work-item-list/assign.spec.js | 8 +++++++- .../work-item-list/basicDragAndDrop.spec.js | 4 ++-- .../work-item/work-item-list/comments.spec.js | 1 + .../displayAndUpdateWorkItemDetails.spec.js | 15 ++++++++++++++- .../work-item-list/displayWorkItemList.spec.js | 3 ++- .../work-item/work-item-list/iteration.spec.js | 1 + .../work-item/work-item-list/linkItem.spec.js | 17 ++++++++++++++--- .../work-item-list/orderOfExecution.spec.js | 1 + .../page-objects/work-item-detail.page.js | 6 +++++- .../page-objects/work-item-list.page.js | 13 +++++++++++++ .../work-item-list/quickadd-workitem.spec.js | 5 +++++ .../work-item/work-item-list/smokeTest.spec.js | 2 ++ .../work-item-list/startcoding.spec.js | 1 + .../testHelpersTestTemplate.spec.js | 1 + .../work-item/work-item-list/testSupport.js | 8 ++++++++ .../work-item-list/unauthorizeduser.spec.js | 1 + .../work-item-detailed-dialog.spec.js | 1 + .../work-item-list/work-item-list.spec.js | 3 ++- .../work-item-list/work-item-timeStamp.spec.js | 3 ++- .../workitem-naughty-string.spec.js | 1 + 21 files changed, 85 insertions(+), 12 deletions(-) diff --git a/protractor.config.js b/protractor.config.js index 7c2020a3b..e5139eb5d 100644 --- a/protractor.config.js +++ b/protractor.config.js @@ -3,7 +3,7 @@ exports.config = { getPageTimeout: 30000, seleniumAddress: 'http://localhost:4444/wd/hub', specs: ['src/tests/**/*.spec.js'], - exclude: ['src/tests/**/TBD/*.spec.js', 'src/tests/**/orderOfExecution.spec.js', 'src/tests/**/work-item-timeStamp.spec.js'], + exclude: ['src/tests/**/TBD/*.spec.js', 'src/tests/**/orderOfExecution.spec.js', 'src/tests/**/work-item-timeStamp.spec.js', 'src/tests/**/testHelpers*.spec.js'], suites: { smokeTest: 'src/tests/**/smokeTest.spec.js' }, diff --git a/src/tests/work-item/work-item-list/assign.spec.js b/src/tests/work-item/work-item-list/assign.spec.js index d625c00b7..1ca88b3cb 100644 --- a/src/tests/work-item/work-item-list/assign.spec.js +++ b/src/tests/work-item/work-item-list/assign.spec.js @@ -24,8 +24,9 @@ describe('Work item list', function () { beforeEach(function () { testSupport.setBrowserMode('desktop'); -// browser.ignoreSynchronization = true; page = new WorkItemListPage(true); + testSupport.setTestSpace(page); + browser.wait(until.elementToBeClickable(page.firstWorkItem), constants.WAIT, 'Failed to find first work item'); }); /**Test searching user in the assignee drop down */ @@ -94,6 +95,7 @@ describe('Work item list', function () { browser.wait(until.elementToBeClickable(detailPage.workItemDetailAssigneeIcon), constants.WAIT, 'Failed to find Assignee Icon'); detailPage.clickworkItemDetailAssigneeIcon(); + browser.wait(until.elementToBeClickable(detailPage.workItemDetailAssigneeSearch), constants.WAIT, 'Failed to find Assignee Icon'); detailPage.setWorkItemDetailAssigneeSearch("Example User 1",false); detailPage.clickAssignedUserDropDownList("Example User 1"); expect(detailPage.details_assigned_user().getText()).toContain("Example User 1"); @@ -117,6 +119,7 @@ describe('Work item list', function () { browser.wait(until.elementToBeClickable(detailPage.workItemDetailAssigneeIcon), constants.WAIT, 'Failed to find Assignee Icon'); detailPage.clickworkItemDetailAssigneeIcon(); + browser.wait(until.elementToBeClickable(detailPage.workItemDetailAssigneeSearch), constants.WAIT, 'Failed to find Assignee Icon'); detailPage.setWorkItemDetailAssigneeSearch("Example User 1",false); detailPage.clickAssignedUserDropDownList("Example User 1"); expect(detailPage.details_assigned_user().getText()).toContain("Example User 1"); @@ -140,6 +143,7 @@ describe('Work item list', function () { browser.wait(until.elementToBeClickable(detailPage.workItemDetailAssigneeIcon), constants.WAIT, 'Failed to find Assignee Icon'); detailPage.clickworkItemDetailAssigneeIcon(); + browser.wait(until.elementToBeClickable(detailPage.workItemDetailAssigneeSearch), constants.WAIT, 'Failed to find Assignee Icon'); detailPage.setWorkItemDetailAssigneeSearch("Example User 1",false); detailPage.clickAssignedUserDropDownList("Example User 1"); expect(detailPage.details_assigned_user().getText()).toContain("Example User 1"); @@ -167,6 +171,7 @@ describe('Work item list', function () { browser.wait(until.elementToBeClickable(detailPage.workItemDetailAssigneeIcon), constants.WAIT, 'Failed to find Assignee Icon'); detailPage.clickworkItemDetailAssigneeIcon(); + browser.wait(until.elementToBeClickable(detailPage.workItemDetailAssigneeSearch), constants.WAIT, 'Failed to find Assignee Icon'); detailPage.setWorkItemDetailAssigneeSearch("Example User 1",false); detailPage.clickAssignedUserDropDownList("Example User 1"); expect(detailPage.details_assigned_user().getText()).toContain("Example User 1"); @@ -193,6 +198,7 @@ describe('Work item list', function () { browser.wait(until.elementToBeClickable(detailPage.workItemDetailAssigneeIcon), constants.WAIT, 'Failed to find Assignee Icon'); detailPage.clickworkItemDetailAssigneeIcon(); + browser.wait(until.elementToBeClickable(detailPage.workItemDetailAssigneeSearch), constants.WAIT, 'Failed to find Assignee Icon'); detailPage.setWorkItemDetailAssigneeSearch("Example User 2",false); detailPage.clickAssignedUserDropDownList("Example User 2"); expect(detailPage.details_assigned_user().getText()).toContain("Example User 2"); diff --git a/src/tests/work-item/work-item-list/basicDragAndDrop.spec.js b/src/tests/work-item/work-item-list/basicDragAndDrop.spec.js index 4f64a0cac..01e188907 100644 --- a/src/tests/work-item/work-item-list/basicDragAndDrop.spec.js +++ b/src/tests/work-item/work-item-list/basicDragAndDrop.spec.js @@ -65,8 +65,8 @@ describe('Drag and drop Test', function () { beforeEach(function () { testSupport.setBrowserMode('desktop'); - page = new WorkItemListPage(true); - + page = new WorkItemListPage(true); + testSupport.setTestSpace(page); }); it('should drag and drop the source into into the target position - phone.', function() { diff --git a/src/tests/work-item/work-item-list/comments.spec.js b/src/tests/work-item/work-item-list/comments.spec.js index 1b44c92ff..e9a1c70d3 100644 --- a/src/tests/work-item/work-item-list/comments.spec.js +++ b/src/tests/work-item/work-item-list/comments.spec.js @@ -23,6 +23,7 @@ var waitTime = 30000; testSupport.setBrowserMode('desktop'); page = new WorkItemListPage(true); detailPage = new WorkItemDetailPage(true); + testSupport.setTestSpace(page); }); it('Verify comments text area, username, comment,time is present -desktop ', function() { page.clickWorkItemTitle(page.firstWorkItem, "id0"); diff --git a/src/tests/work-item/work-item-list/displayAndUpdateWorkItemDetails.spec.js b/src/tests/work-item/work-item-list/displayAndUpdateWorkItemDetails.spec.js index 743a9f472..219796503 100644 --- a/src/tests/work-item/work-item-list/displayAndUpdateWorkItemDetails.spec.js +++ b/src/tests/work-item/work-item-list/displayAndUpdateWorkItemDetails.spec.js @@ -38,6 +38,7 @@ var waitTime = 30000; testSupport.setBrowserMode('phone'); page = new WorkItemListPage(true); + testSupport.setTestSpace(page); }); /* Create a new workitem, fill in the details, save, retrieve, update, save, verify updates are saved */ @@ -416,6 +417,8 @@ it('Verify how many work item type exists in drop down - desktop', function() { expect(page.workItemTitle(page.firstWorkItem)).toBe(workItemTitle); page.workItemViewId(page.workItemByTitle(workItemTitle)).getText().then(function (text) { var detailPage = page.clickWorkItemTitle(page.firstWorkItem, text); + + browser.wait(until.elementToBeClickable(detailPage.workItemStateDropDownButton), constants.WAIT, 'Failed to find workItemStateDropDownButton'); detailPage.clickWorkItemStateDropDownButton(); var wi_state = ["new", "open", "in progress","resolved","closed"]; var itr=1; @@ -436,6 +439,8 @@ it('Verify how many work item type exists in drop down - desktop', function() { page.clickQuickAddSave().then(function() { page.workItemViewId(page.workItemByTitle(workItemTitle)).getText().then(function (text) { var detailPage = page.clickWorkItemTitle(page.firstWorkItem, text); + + browser.wait(until.elementToBeClickable(detailPage.workItemStateDropDownButton), constants.WAIT, 'Failed to find workItemStateDropDownButton'); detailPage.clickWorkItemStateDropDownButton(); detailPage.WorkItemStateDropDownList().get(0).click(); detailPage.clickWorkItemDetailCloseButton(); @@ -452,10 +457,12 @@ it('Verify how many work item type exists in drop down - desktop', function() { page.typeQuickAddWorkItemTitle(workItemTitle); page.clickQuickAddSave().then(function() { - browser.wait(until.elementToBeClickable(page.workItemTitle(page.firstWorkItem)), constants.WAIT, 'Failed to find Assignee Icon'); + browser.wait(until.elementToBeClickable(page.workItemTitle(page.firstWorkItem)), constants.WAIT, 'Failed to find firstWorkItem'); page.workItemViewId(page.workItemByTitle(workItemTitle)).getText().then(function (text) { var detailPage = page.clickWorkItemTitle(page.firstWorkItem, text); + + browser.wait(until.elementToBeClickable(detailPage.workItemStateDropDownButton), constants.WAIT, 'Failed to find workItemStateDropDownButton'); detailPage.clickWorkItemStateDropDownButton(); detailPage.WorkItemStateDropDownList().get(1).click(); detailPage.clickWorkItemDetailCloseButton(); @@ -473,6 +480,8 @@ it('Verify how many work item type exists in drop down - desktop', function() { page.clickQuickAddSave().then(function() { page.workItemViewId(page.workItemByTitle(workItemTitle)).getText().then(function (text) { var detailPage = page.clickWorkItemTitle(page.firstWorkItem, text); + + browser.wait(until.elementToBeClickable(detailPage.workItemStateDropDownButton), constants.WAIT, 'Failed to find workItemStateDropDownButton'); detailPage.clickWorkItemStateDropDownButton(); detailPage.WorkItemStateDropDownList().get(2).click(); detailPage.clickWorkItemDetailCloseButton(); @@ -490,6 +499,8 @@ it('Verify how many work item type exists in drop down - desktop', function() { page.clickQuickAddSave().then(function() { page.workItemViewId(page.workItemByTitle(workItemTitle)).getText().then(function (text) { var detailPage = page.clickWorkItemTitle(page.firstWorkItem, text); + + browser.wait(until.elementToBeClickable(detailPage.workItemStateDropDownButton), constants.WAIT, 'Failed to find workItemStateDropDownButton'); detailPage.clickWorkItemStateDropDownButton(); detailPage.WorkItemStateDropDownList().get(3).click(); detailPage.clickWorkItemDetailCloseButton(); @@ -507,6 +518,8 @@ it('Verify how many work item type exists in drop down - desktop', function() { page.clickQuickAddSave().then(function() { page.workItemViewId(page.workItemByTitle(workItemTitle)).getText().then(function (text) { var detailPage = page.clickWorkItemTitle(page.firstWorkItem, text); + + browser.wait(until.elementToBeClickable(detailPage.workItemStateDropDownButton), constants.WAIT, 'Failed to find workItemStateDropDownButton'); detailPage.clickWorkItemStateDropDownButton(); detailPage.WorkItemStateDropDownList().get(4).click(); detailPage.clickWorkItemDetailCloseButton(); diff --git a/src/tests/work-item/work-item-list/displayWorkItemList.spec.js b/src/tests/work-item/work-item-list/displayWorkItemList.spec.js index 6ebafdf17..a90dc42ec 100644 --- a/src/tests/work-item/work-item-list/displayWorkItemList.spec.js +++ b/src/tests/work-item/work-item-list/displayWorkItemList.spec.js @@ -23,7 +23,8 @@ describe('Work item list', function () { beforeEach(function () { testSupport.setBrowserMode('phone'); - page = new WorkItemListPage(true); + page = new WorkItemListPage(true); + testSupport.setTestSpace(page); workItemMockData = { pageTitle:'Title Text 0 Details', diff --git a/src/tests/work-item/work-item-list/iteration.spec.js b/src/tests/work-item/work-item-list/iteration.spec.js index fc6fa1a47..bd5807c26 100644 --- a/src/tests/work-item/work-item-list/iteration.spec.js +++ b/src/tests/work-item/work-item-list/iteration.spec.js @@ -21,6 +21,7 @@ var waitTime = 30000; beforeEach(function () { testSupport.setBrowserMode('desktop'); page = new WorkItemListPage(true); + testSupport.setTestSpace(page); }); it('Verify Iteration add button and label are clickable + dialoge label is present -phone ', function() { expect(page.iterationAddButton().isPresent()).toBe(true); diff --git a/src/tests/work-item/work-item-list/linkItem.spec.js b/src/tests/work-item/work-item-list/linkItem.spec.js index f7fe9521a..e8b6eb8dc 100644 --- a/src/tests/work-item/work-item-list/linkItem.spec.js +++ b/src/tests/work-item/work-item-list/linkItem.spec.js @@ -16,21 +16,26 @@ var WorkItemListPage = require('./page-objects/work-item-list.page'), testSupport = require('./testSupport'), + constants = require('./constants'), WorkItemDetailPage = require('./page-objects/work-item-detail.page'); describe('Link item ', function () { var page, items, browserMode; + var until = protractor.ExpectedConditions; beforeEach(function () { testSupport.setBrowserMode('desktop'); page = new WorkItemListPage(true); - // detailPage = new WorkItemDetailPage(); + // detailPage = new WorkItemDetailPage(); + testSupport.setTestSpace(page); }); it('Create a link item planner to planner - Desktop', function () { var detailPage = page.clickWorkItemTitle(page.workItemByTitle("Title Text 3"), "id3"); expect(detailPage.commentDiv().isPresent()).toBe(true); expect(detailPage.linkItemHeaderCaret().isPresent()).toBe(true); + + browser.wait(until.elementToBeClickable(detailPage.linkItemHeaderCaret()), constants.WAIT, 'Link icon is not clickable'); detailPage.linkItemHeaderCaret().click(); detailPage.clickCreateLinkButton(); detailPage.clickLinkDropDown(); @@ -49,6 +54,8 @@ describe('Link item ', function () { var detailPage = page.clickWorkItemTitle(page.workItemByTitle("Title Text 0"), "id0"); expect(detailPage.commentDiv().isPresent()).toBe(true); expect(detailPage.linkItemHeaderCaret().isPresent()).toBe(true); + + browser.wait(until.elementToBeClickable(detailPage.linkItemHeaderCaret()), constants.WAIT, 'Link icon is not clickable'); detailPage.linkItemHeaderCaret().click(); /**Below commented code works fine with the Chrome not with PhantomJS * Issue : https://github.com/fabric8io/fabric8-planner/issues/319 @@ -61,7 +68,9 @@ describe('Link item ', function () { it('Delete link and check if it exists in list or not - Desktop', function () { var detailPage = page.clickWorkItemTitle(page.workItemByTitle("Title Text 0"), "id0"); expect(detailPage.commentDiv().isPresent()).toBe(true); - expect(detailPage.linkItemHeaderCaret().isPresent()).toBe(true); + expect(detailPage.linkItemHeaderCaret().isPresent()).toBe(true); + + browser.wait(until.elementToBeClickable(detailPage.linkItemHeaderCaret()), constants.WAIT, 'Link icon is not clickable'); detailPage.linkItemHeaderCaret().click(); /**Below commented code works fine with the Chrome not with PhantomJS * Issue : https://github.com/fabric8io/fabric8-planner/issues/319 @@ -96,7 +105,9 @@ describe('Link item ', function () { it('Check the elements of link item div are visible - Desktop', function () { var detailPage = page.clickWorkItemTitle(page.workItemByTitle("Title Text 0"), "id0"); expect(detailPage.commentDiv().isPresent()).toBe(true); - expect(detailPage.linkItemHeaderCaret().isPresent()).toBe(true); + expect(detailPage.linkItemHeaderCaret().isPresent()).toBe(true); + + browser.wait(until.elementToBeClickable(detailPage.linkItemHeaderCaret()), constants.WAIT, 'Link icon is not clickable'); detailPage.linkItemHeaderCaret().click(); // expect(detailPage.linkItemTitle()).toBe("This item, Title Text 0"); // expect(detailPage.checkLinkDropDown.isPresent()).toBe(true); diff --git a/src/tests/work-item/work-item-list/orderOfExecution.spec.js b/src/tests/work-item/work-item-list/orderOfExecution.spec.js index b67ba512f..01a29a488 100644 --- a/src/tests/work-item/work-item-list/orderOfExecution.spec.js +++ b/src/tests/work-item/work-item-list/orderOfExecution.spec.js @@ -55,6 +55,7 @@ defaultWorkitemsPhantomJS = [ beforeEach(function () { testSupport.setBrowserMode('phone'); page = new WorkItemListPage(true); + testSupport.setTestSpace(page); }); it('should move workitem down/up - phone.', function() { diff --git a/src/tests/work-item/work-item-list/page-objects/work-item-detail.page.js b/src/tests/work-item/work-item-list/page-objects/work-item-detail.page.js index f89d2b2f8..d946ce612 100644 --- a/src/tests/work-item/work-item-list/page-objects/work-item-detail.page.js +++ b/src/tests/work-item/work-item-list/page-objects/work-item-detail.page.js @@ -248,6 +248,10 @@ class WorkItemDetailPage { return element(by.xpath('.//*[@id="wi-detail-form"]/fieldset/div[2]/div[2]/div/ul/li['+typeString+']/a/span[2]')).getText(); } + get workItemStateDropDownButton () { + return element(by.id("wi-detail-state")); + } + clickWorkItemStateDropDownButton () { return element(by.id("wi-detail-state")).click(); } @@ -501,7 +505,7 @@ class WorkItemDetailPage { return this.startCodingElement.click(); } startCodingDiv (){ - return element(by.css(".start-coding")); + return element(by.id("start-coding-link")); } } diff --git a/src/tests/work-item/work-item-list/page-objects/work-item-list.page.js b/src/tests/work-item/work-item-list/page-objects/work-item-list.page.js index 79d69e2e7..20f825e24 100644 --- a/src/tests/work-item/work-item-list/page-objects/work-item-list.page.js +++ b/src/tests/work-item/work-item-list/page-objects/work-item-list.page.js @@ -45,6 +45,19 @@ class WorkItemListPage { browser.get("http://localhost:8088/"); } }; + + /* Select the space in which the tests will be run */ + get spaceDropdown (){ + return element(by.css(".ng-valid")); + } + clickOnSpaceDropdown (){ + return this.spaceDropdown.click(); + } + selectSpaceDropDownValue (index) { + index++; + return element(by.xpath("//select[contains(@class,'ng-valid')]/option[" + index + "]")).click(); + } + workItemByURLId (workItemId) { browser.get("http://localhost:8088/work-item/list/detail/"+ workItemId); var theDetailPage = new WorkItemDetailPage (workItemId); diff --git a/src/tests/work-item/work-item-list/quickadd-workitem.spec.js b/src/tests/work-item/work-item-list/quickadd-workitem.spec.js index 65e42b08a..d8fb7d8ce 100644 --- a/src/tests/work-item/work-item-list/quickadd-workitem.spec.js +++ b/src/tests/work-item/work-item-list/quickadd-workitem.spec.js @@ -22,9 +22,12 @@ describe('Work item list', function () { var page, items, browserMode; var char255 = '
+
'; var char255Expected = '
+
'; + var until = protractor.ExpectedConditions; + beforeEach(function () { testSupport.setBrowserMode('desktop'); page = new WorkItemListPage(true); + testSupport.setTestSpace(page); }); it('Creating a new quick add work item and delete - desktop.', function () { @@ -37,6 +40,7 @@ describe('Work item list', function () { page.clickWorkItemKebabButton(page.firstWorkItem); page.clickWorkItemKebabDeleteButton(page.firstWorkItem); page.clickWorkItemPopUpDeleteConfirmButton().then(function() { + browser.wait(until.textToBePresentInElement((page.firstWorkItem), "Title Text" ), 60000, 'Failed to find text in workitem'); expect(page.workItemTitle(page.firstWorkItem)).not.toBe('Quick Add and Delete'); expect(page.workItemTitle(page.workItemByNumber(0))).not.toBe('Quick Add and Delete'); }); @@ -53,6 +57,7 @@ describe('Work item list', function () { page.clickWorkItemKebabButton(page.firstWorkItem); page.clickWorkItemKebabDeleteButton(page.firstWorkItem); page.clickWorkItemPopUpDeleteCancelConfirmButton().then(function() { + browser.wait(until.textToBePresentInElement((page.firstWorkItem), char255Expected), constants.WAIT, 'Failed to text in workitem'); expect(page.workItemTitle(page.firstWorkItem)).toBe(char255Expected); expect(page.workItemTitle(page.workItemByNumber(0))).toBe(char255Expected); }); diff --git a/src/tests/work-item/work-item-list/smokeTest.spec.js b/src/tests/work-item/work-item-list/smokeTest.spec.js index f6b7e95a1..1ee1a3ff9 100644 --- a/src/tests/work-item/work-item-list/smokeTest.spec.js +++ b/src/tests/work-item/work-item-list/smokeTest.spec.js @@ -33,6 +33,7 @@ describe('Work item list', function () { beforeEach(function () { testSupport.setBrowserMode('desktop'); page = new WorkItemListPage(true); + testSupport.setTestSpace(page); }); /* User can read, update, remove assignee on a workitem */ @@ -159,6 +160,7 @@ describe('Work item list', function () { var detailPage = page.clickWorkItemTitle(page.firstWorkItem, "Title Text 0"); browser.wait(until.elementToBeClickable(page.firstWorkItem), constants.WAIT, 'Failed to find workItem'); expect(detailPage.getCreatedtime()).toBe('a few seconds ago'); + browser.wait(until.elementToBeClickable(detailPage.workItemDetailCloseButton), constants.WAIT, 'Failed to find close workItem detail page'); detailPage.clickWorkItemDetailCloseButton(); // detailPage = page.workItemByURLId("id1"); diff --git a/src/tests/work-item/work-item-list/startcoding.spec.js b/src/tests/work-item/work-item-list/startcoding.spec.js index 6c4d6e45a..499e51796 100644 --- a/src/tests/work-item/work-item-list/startcoding.spec.js +++ b/src/tests/work-item/work-item-list/startcoding.spec.js @@ -26,6 +26,7 @@ var waitTime = 30000; beforeEach(function () { testSupport.setBrowserMode('desktop'); page = new WorkItemListPage(true); + testSupport.setTestSpace(page); }); it('Verify start coding is visible when code base is presrent - Desktop', function () { var detailPage = page.clickWorkItemTitle(page.workItemByTitle("Title Text 0"), "id0"); diff --git a/src/tests/work-item/work-item-list/testHelpersTestTemplate.spec.js b/src/tests/work-item/work-item-list/testHelpersTestTemplate.spec.js index 01bc9ddef..55ab7fd7b 100644 --- a/src/tests/work-item/work-item-list/testHelpersTestTemplate.spec.js +++ b/src/tests/work-item/work-item-list/testHelpersTestTemplate.spec.js @@ -25,6 +25,7 @@ describe('Work item list', function () { beforeEach(function () { testSupport.setBrowserMode('desktop'); page = new WorkItemListPage(true); + testSupport.setTestSpace(page); }); it('Quick Create workitem', function () { diff --git a/src/tests/work-item/work-item-list/testSupport.js b/src/tests/work-item/work-item-list/testSupport.js index 24ed01174..f56d26c63 100644 --- a/src/tests/work-item/work-item-list/testSupport.js +++ b/src/tests/work-item/work-item-list/testSupport.js @@ -31,6 +31,14 @@ module.exports = { } }, +/** + * Set the windows in which the tests will run + */ + setTestSpace: function (page) { + page.clickOnSpaceDropdown(); + page.selectSpaceDropDownValue("1"); + }, + /** * Write screenshot to file * Example usage: diff --git a/src/tests/work-item/work-item-list/unauthorizeduser.spec.js b/src/tests/work-item/work-item-list/unauthorizeduser.spec.js index 01d52cf41..b464d382e 100644 --- a/src/tests/work-item/work-item-list/unauthorizeduser.spec.js +++ b/src/tests/work-item/work-item-list/unauthorizeduser.spec.js @@ -30,6 +30,7 @@ describe('Work item list', function () { testSupport.setBrowserMode('phone'); page = new WorkItemListPage(false); detailPage=new WorkItemDetailPage(1); + testSupport.setTestSpace(page); }); /*Test Quick add work item should not be visible*/ diff --git a/src/tests/work-item/work-item-list/work-item-detailed-dialog.spec.js b/src/tests/work-item/work-item-list/work-item-detailed-dialog.spec.js index f9fd6dc9f..7cfe274c8 100644 --- a/src/tests/work-item/work-item-list/work-item-detailed-dialog.spec.js +++ b/src/tests/work-item/work-item-list/work-item-detailed-dialog.spec.js @@ -30,6 +30,7 @@ describe('Work item list', function () { beforeEach(function () { testSupport.setBrowserMode('desktop'); page = new WorkItemListPage(true); + testSupport.setTestSpace(page); }); it('Create WorkItem and creatorname and image is relecting', function () { diff --git a/src/tests/work-item/work-item-list/work-item-list.spec.js b/src/tests/work-item/work-item-list/work-item-list.spec.js index a52dd7f35..e659cf64d 100644 --- a/src/tests/work-item/work-item-list/work-item-list.spec.js +++ b/src/tests/work-item/work-item-list/work-item-list.spec.js @@ -23,7 +23,8 @@ describe('Work item list', function () { beforeEach(function () { testSupport.setBrowserMode('phone'); browser.ignoreSynchronization = true; - page = new WorkItemListPage(true); + page = new WorkItemListPage(true); + testSupport.setTestSpace(page); workItemMockData = { pageTitle:'Title Text 0 Details', diff --git a/src/tests/work-item/work-item-list/work-item-timeStamp.spec.js b/src/tests/work-item/work-item-list/work-item-timeStamp.spec.js index 1c38a01df..8d5932d40 100644 --- a/src/tests/work-item/work-item-list/work-item-timeStamp.spec.js +++ b/src/tests/work-item/work-item-list/work-item-timeStamp.spec.js @@ -24,7 +24,8 @@ describe('Work item list', function () { detailPage = new WorkItemDetailPage(); beforeEach(function () { testSupport.setBrowserMode('desktop'); - page = new WorkItemListPage(true); + page = new WorkItemListPage(true); + testSupport.setTestSpace(page); }); diff --git a/src/tests/work-item/work-item-list/workitem-naughty-string.spec.js b/src/tests/work-item/work-item-list/workitem-naughty-string.spec.js index 4deb79240..3473f7650 100644 --- a/src/tests/work-item/work-item-list/workitem-naughty-string.spec.js +++ b/src/tests/work-item/work-item-list/workitem-naughty-string.spec.js @@ -38,6 +38,7 @@ var UnicodeNumbers = "123١٢٣"; beforeEach(function () { testSupport.setBrowserMode('phone'); page = new WorkItemListPage(true); + testSupport.setTestSpace(page); }); it('Quick create UnicodeSymbols workitems', function () { quickCreateWorkItem (UnicodeSymbols); });