Skip to content

Commit

Permalink
CP-3181 [Help Section] Example of no results in search bar of Help Se…
Browse files Browse the repository at this point in the history
…ction (#2131)

Co-authored-by: Milena Niebrzydowska <[email protected]>
  • Loading branch information
milenaniebrzydowska00 and Milena Niebrzydowska authored Oct 17, 2024
1 parent 25f3149 commit 061b32b
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apps/mudita-center-e2e/src/page-objects/help.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ class HelpPage extends Page {
public get helpSearchResults() {
return $('[data-testid="help-search-results"]')
}
public get iconSearchHelpSearchResults() {
return $('[data-testid="help-search-results"] [data-testid="icon-search"]')
}
public get helpSearchResultsParagraph() {
return $('[data-testid="help-search-results"] p')
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* 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 HelpPage from "../../page-objects/help.page"
import HomePage from "../../page-objects/home.page"

describe("Check Help search for no results", () => {
before(async () => {
//Click Not Now button
const notNowButton = await HomePage.notNowButton
await notNowButton.waitForDisplayed()
await notNowButton.click()
//Open Help page
const helpTab = await NavigationTabs.helpTab
await helpTab.waitForDisplayed({ timeout: 15000 })
await helpTab.click()
})

it("Search for not existing article and verify no results information", async () => {
//Search for not existing article by entering not findable string (special characters)
const helpSearchInput = await HelpPage.helpSearchInput
await helpSearchInput.setValue("!@#$%^&*()")

//Verify quick search: no results information
const helpSearchResults = await HelpPage.helpSearchResults
await expect(helpSearchResults).toBeDisplayed()
const iconSearchHelpSearchResults = await HelpPage.iconSearchHelpSearchResults
await expect(iconSearchHelpSearchResults).toBeDisplayed()
await expect(helpSearchResults).toHaveText("We couldn't find any topics...")
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ export enum TestFilesPaths {
contactSupportUnhappyPath = "src/specs/help/contact-support-unhappy-path.ts",
kompaktBackupModalGettingInitialInfo = "src/specs/overview/kompakt-backup-getting-initial-info.ts",
helpVerifyFeedback = "src/specs/help/help-verify-feedback.ts",
helpSectionSearchNoResults = "src/specs/help/help-section-search-noresults.e2e.ts",
}
export const toRelativePath = (path: string) => `./${path}`
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 @@ -80,6 +80,7 @@ export const config: Options.Testrunner = {
toRelativePath(TestFilesPaths.contactSupportUnhappyPath),
toRelativePath(TestFilesPaths.kompaktBackupModalGettingInitialInfo),
toRelativePath(TestFilesPaths.helpVerifyFeedback),
toRelativePath(TestFilesPaths.helpSectionSearchNoResults),
],
suites: {
standalone: [
Expand All @@ -94,6 +95,7 @@ export const config: Options.Testrunner = {
toRelativePath(TestFilesPaths.licenseTest),
toRelativePath(TestFilesPaths.contactSupportUnhappyPath),
toRelativePath(TestFilesPaths.helpVerifyFeedback),
toRelativePath(TestFilesPaths.helpSectionSearchNoResults),
],
mock: [
toRelativePath(TestFilesPaths.mcCheckForUpdatesTest),
Expand Down Expand Up @@ -130,6 +132,7 @@ export const config: Options.Testrunner = {
toRelativePath(TestFilesPaths.contactSupportUnhappyPath),
toRelativePath(TestFilesPaths.newsMoreNews),
toRelativePath(TestFilesPaths.helpVerifyFeedback),
toRelativePath(TestFilesPaths.helpSectionSearchNoResults),
],
cicdMock: [
toRelativePath(TestFilesPaths.contactSupportUnhappyPath),
Expand Down

0 comments on commit 061b32b

Please sign in to comment.