Skip to content

Commit

Permalink
CP-2747 added new test and one new selector thats indicated the href …
Browse files Browse the repository at this point in the history
…for More News button
  • Loading branch information
robertmudi committed Oct 8, 2024
1 parent 8f4fcb5 commit 334ff9f
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apps/mudita-center-e2e/src/page-objects/news.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ class NewsPage extends Page {
return $("p*=More news")
}

public get moreNewsButtonHref() {
return $('a[href="https://www.mudita.com/#news"]')
}

public get newsCardElements() {
return $$('[data-testid="news-card"]')
}
Expand Down
31 changes: 31 additions & 0 deletions apps/mudita-center-e2e/src/specs/news/more-news.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* Copyright (c) Mudita sp. z o.o. All rights reserved.
* For licensing, see https://github.com/mudita/mudita-center/blob/master/LICENSE.md
*/

import NavigationTabs from "../../page-objects/tabs.page"
import HomePage from "../../page-objects/home.page"
import NewsPage from "../../page-objects/news.page"

describe("Check more news button", () => {
it("Click Not Now and Open Mudita News", async () => {
const notNowButton = await HomePage.notNowButton
await expect(notNowButton).toBeClickable()
await notNowButton.click()
const muditaNewsTab = NavigationTabs.muditaNewsTab
await expect(muditaNewsTab).toBeDisplayed()
})

it("Check Mudita News Header, check More News button href", async () => {
const newsHeader = NewsPage.newsHeader
await expect(newsHeader).toBeDisplayed()
await expect(newsHeader).toHaveText("Mudita News")

const moreNewsButton = await NewsPage.moreNewsButton
await expect(moreNewsButton).toBeDisplayed()

const moreNewsButtonHref = NewsPage.moreNewsButtonHref
const checkHref = await moreNewsButtonHref.getAttribute("href")
await expect(checkHref).toBe("https://www.mudita.com/#news")
})
})

0 comments on commit 334ff9f

Please sign in to comment.