Skip to content

Commit

Permalink
CP-2747 [E2E][HomePage] More news (#2117)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertmudi authored Oct 10, 2024
1 parent e187d81 commit 499a8d8
Show file tree
Hide file tree
Showing 4 changed files with 39 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")
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export enum TestFilesPaths {
e2eMockSample = "src/specs/overview/e2e-mock-sample.e2e.ts",
mcCheckForUpdatesTest = "src/specs/settings/mc-version-check-for-updates.e2e.ts",
newsPageOnlineTest = "src/specs/news/news-check-online.e2e.ts",
newsMoreNews = "src/specs/news/more-news.e2e.ts",
newsPageOfflineTest = "src/specs/news/news-check-offline.e2e.ts",
termsOfServiceTest = "src/specs/settings/terms-of-service.e2e.ts",
backupLocationTest = "src/specs/settings/backup-location.e2e.ts",
Expand Down
3 changes: 3 additions & 0 deletions apps/mudita-center-e2e/wdio.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export const config: Options.Testrunner = {
toRelativePath(TestFilesPaths.homePageTestDeviceNotConnectedTest),
toRelativePath(TestFilesPaths.newsPageOnlineTest),
toRelativePath(TestFilesPaths.newsPageOfflineTest),
toRelativePath(TestFilesPaths.newsMoreNews),
toRelativePath(TestFilesPaths.termsOfServiceTest),
toRelativePath(TestFilesPaths.backupLocationTest),
toRelativePath(TestFilesPaths.mcCheckForUpdatesOfflineTest),
Expand All @@ -84,6 +85,7 @@ export const config: Options.Testrunner = {
//toRelativePath(TestFilesPaths.helpSectionCheckTest),
//toRelativePath(TestFilesPaths.homePageTestDeviceNotConnectedTest),
toRelativePath(TestFilesPaths.newsPageOnlineTest),
toRelativePath(TestFilesPaths.newsMoreNews),
toRelativePath(TestFilesPaths.termsOfServiceTest),
toRelativePath(TestFilesPaths.backupLocationTest),
toRelativePath(TestFilesPaths.privacyPolicyTest),
Expand Down Expand Up @@ -123,6 +125,7 @@ export const config: Options.Testrunner = {
toRelativePath(TestFilesPaths.newsPageOnlineTest),
toRelativePath(TestFilesPaths.termsOfServiceTest),
toRelativePath(TestFilesPaths.contactSupportUnhappyPath),
toRelativePath(TestFilesPaths.newsMoreNews),
],
cicdMock: [
toRelativePath(TestFilesPaths.contactSupportUnhappyPath),
Expand Down

0 comments on commit 499a8d8

Please sign in to comment.