Skip to content

Commit

Permalink
#3442: Add client side test for number of pending approval reports
Browse files Browse the repository at this point in the history
  • Loading branch information
cemalettin-work authored and gjvoosten committed Feb 24, 2021
1 parent 8fd3c72 commit 6a6b1ee
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
12 changes: 12 additions & 0 deletions client/tests/webdriver/baseSpecs/homeTiles.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { expect } from "chai"
import Home from "../pages/home.page"

describe("When checking the home page tiles", () => {
it("Should see correct number of pendingApprovalOf reports count when logged in as Arthur", () => {
Home.openAsAdminUser()
Home.homeTilesContainer.waitForExist()
Home.homeTilesContainer.waitForDisplayed()
// Depends on test data
expect(Home.pendingMyApprovalOfCount.getText()).to.eq("2")
})
})
10 changes: 10 additions & 0 deletions client/tests/webdriver/pages/home.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ class Home extends Page {
return browser.$("#searchBarInput")
}

get homeTilesContainer() {
return browser.$("fieldset.home-tile-row")
}

get pendingMyApprovalOfCount() {
return browser
.$('//button[contains(text(), "Reports pending my approval")]')
.$("h1")
}

get submitSearch() {
return browser.$("#topbar #searchBarSubmit")
}
Expand Down

0 comments on commit 6a6b1ee

Please sign in to comment.