Skip to content

Commit

Permalink
Merge pull request #5 from DEFRA/sprint6-locationMonitoringStationLis…
Browse files Browse the repository at this point in the history
…tPage-AQD-357

sprint6-locationMonitoringStationListPage-AQD-357
  • Loading branch information
jamesfisherCOG authored Mar 5, 2025
2 parents fcdb0f5 + 4c4771c commit c1c4895
Show file tree
Hide file tree
Showing 5 changed files with 562 additions and 36 deletions.
64 changes: 64 additions & 0 deletions test/page-objects/locationMonitoringStationListPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import { $ } from '@wdio/globals'

class LocationMonitoringStationListPage {
get getMonitoringStationListPageHeading() {
return $("h1[class*='govuk-heading-xl govuk-!-margin-bottom-6']")
}

get getMonitoringStationListPageContent() {
return $("main[class*='govuk-main-wrapper app-main-wrapper']")
}

get getBackLink() {
return $("a[class='govuk-back-link']")
}

get getChangeSearchAreaLink() {
return $("a[href='/search-location']")
}

get getMonitoringStationLink() {
return (text) => $(`//a[contains(text(),'${text}')]`)
}

get getMonitoringStationTableHeading() {
return $("th[class='govuk-table__header govuk-!-width-one-half']")
}

get getSiteTypeTableHeading() {
return $("th[class='govuk-table__header govuk-!-width-one-quarter']")
}

get getPollutantsTableHeading() {
return $(
"th[class='govuk-table__header govuk-table__header--numeric govuk-!-width-one-quarter']"
)
}

get getParagraph() {
return $$("p[class='govuk-body']")[1]
}

get getListItem() {
return $('li')
}

get getList() {
return $("ul[class='govuk-list']")
}

get getTableHeaderPadding() {
return $("tr[class='govuk-table__header']")
}

get getTablecell1Padding() {
return $("th[class='govuk-table__cell']")
}

get getTablecell2Padding() {
return $("td[class='govuk-table__cell govuk-table__cell--numeric']")
}
}

// module.exports=new StartNowPage()
export default new LocationMonitoringStationListPage()
13 changes: 0 additions & 13 deletions test/page-objects/page.js

This file was deleted.

18 changes: 0 additions & 18 deletions test/page-objects/resultsPage.js

This file was deleted.

10 changes: 5 additions & 5 deletions test/specs/disambigurationPageValidation.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import searchPage from '../page-objects/searchPage.js'
import headersObject from '../page-objects/header.js'
import footer from '../page-objects/footer.js'
import disambigurationPage from '../page-objects/disambigurationPage.js'
import monitoringStationPage from '../page-objects/monitoringStationPage.js'
import styling from '../page-objects/styling.js'
import locationMonitoringStationListPage from '../page-objects/locationMonitoringStationListPage.js'

describe('disambiguration page tests', () => {
it('content, functions, styling tests', async () => {
Expand Down Expand Up @@ -99,7 +99,7 @@ Alternatively, try searching again`
await searchPage.defaultOption.isSelected()
await expect(defaultMilesOptionIsSelectedAfterSearchAgain).toBe(true)

// checking monitoring station links
// checking location links
await searchPage.milesOptionClick('25 miles')
await searchPage.continueBtnClick()
await browser.refresh
Expand All @@ -109,7 +109,7 @@ Alternatively, try searching again`
const expectedURLCityOfLondon =
'https://aqie-dataselector-frontend.test.cdp-int.defra.cloud/location/city-of-london_city-and-county-of-the-city-of-london'
await expect(getCurrentURLCityOfLondon).toMatch(expectedURLCityOfLondon)
monitoringStationPage.getBackBtn.click()
locationMonitoringStationListPage.getBackLink.click()
browser.refresh()

await disambigurationPage.locationLinkClick('Little London')
Expand All @@ -119,7 +119,7 @@ Alternatively, try searching again`
await expect(getCurrentURLLittleLondonBucks).toMatch(
expectedURLLittleLondonBucks
)
await monitoringStationPage.getBackBtn.click()
await locationMonitoringStationListPage.getBackLink.click()
await browser.refresh()

await disambigurationPage.locationLinkClick('London Fields')
Expand All @@ -129,7 +129,7 @@ Alternatively, try searching again`
await expect(getCurrentURLLondonFIeldsDudley).toMatch(
expectedURLLondonFIeldsDudley
)
await monitoringStationPage.getBackBtn.click()
await locationMonitoringStationListPage.getBackLink.click()
await browser.refresh()

// styling tests
Expand Down
Loading

0 comments on commit c1c4895

Please sign in to comment.