# Test info

- Name: Function case for contact tests >> DASHBOARD_007 - Verify feedback feature
- Location: /root/code/portal-automation-test/tests/dashboard/function.spec.ts:225:9

# Error details

```
Error: Timed out 10000ms waiting for expect(locator).toBeVisible()

Locator: locator('//div[@id=\'root\' and @class=\'dashboard-index\']')
Expected: visible
Received: <element(s) not found>
Call log:
  - expect.toBeVisible with timeout 10000ms
  - waiting for locator('//div[@id=\'root\' and @class=\'dashboard-index\']')

    at /root/code/portal-automation-test/tests/dashboard/function.spec.ts:18:60
```

# Page snapshot

```yaml
- heading "Two-factor authentication" [level=2]
- paragraph: Enter the 6 digits from your authenticator app and press confirm.
- textbox
- textbox
- textbox
- text: "-"
- textbox
- textbox
- textbox
- link "Cancel":
  - /url: https://qa.loprx.com/logout
- button "Confirm":
  - img
  - text: Confirm
```

# Test source

```ts
   1 | import path from "path";
   2 | import { test, expect } from "../../fixtures/index";
   3 | import { DashboardPage } from "../../pom/dashboard.page";
   4 | import { LoginPage } from "../../pom/login.page";
   5 | import { randomString } from "../../utils/array";
   6 | import { verifyScreenshot } from "../../utils/screenshot";
   7 |
   8 | test.describe("Function case for contact tests", async () => {
   9 |     let loginPage: LoginPage;
   10 |     let dashboardPage: DashboardPage;
   11 |
   12 |     test.beforeEach(async ({ page, conf }) => {
   13 |         loginPage = new LoginPage(page);
   14 |         dashboardPage = new DashboardPage(page);
   15 |
   16 |         await loginPage.open();
   17 |         await loginPage.login(conf.data.username, conf.data.password);
>  18 |         await expect(loginPage.baseLoc.dashboardContainer).toBeVisible();
      |                                                            ^ Error: Timed out 10000ms waiting for expect(locator).toBeVisible()
   19 |     });
   20 |
   21 |     test("DASHBOARD_001 - Verify when change page had change the title", {
   22 |         tag: ['@DASHBOARD_001', '@dashboard', '@function']
   23 |     }, async () => {
   24 |         for (const { name, link } of dashboardPage.pages) {
   25 |             await test.step(`Verify page ${name} avaible`, async () => {
   26 |                 await dashboardPage.go(link);
   27 |                 await expect(dashboardPage.dashboardLoc.namePage).toContainText(name);
   28 |                 expect(await dashboardPage.page.title()).toContain(name)
   29 |             })
   30 |         }
   31 |     })
   32 |
   33 |     test("DASHBOARD_002 - Verify when click search requests in the columns status detail", {
   34 |         tag: ['@DASHBOARD_002', '@dashboard', '@function']
   35 |     }, async () => {
   36 |         await test.step("Choose Tab All request and filter by Year to Date", async () => {
   37 |             await dashboardPage.dashboardLoc.monitorTab("TAB_MY_TEAM_HUB_ON_DASHBOARD").click();
   38 |             await dashboardPage.dashboardLoc.filterMonitor.arrowDropdown(2).click();
   39 |             await dashboardPage.dashboardLoc.filterMonitor.dropdownFilterOption("Year to Date").click()
   40 |         })
   41 |
   42 |         await test.step("Click on the chart item 'TeamxRequest' and verify the request list", async () => {
   43 |             await dashboardPage.dashboardLoc.filterMonitor.itemChartTeamRequest.click();
   44 |             await expect(dashboardPage.dashboardLoc.filterMonitor.tabRequest("Team Request")).toHaveClass(/active/);
   45 |         })
   46 |
   47 |         await test.step("Click on the chart item 'SharedxWithxTeam' and verify the request list", async () => {
   48 |             await dashboardPage.go("");
   49 |             await dashboardPage.dashboardLoc.filterMonitor.itemChartShareWithTeam.click();
   50 |             await expect(dashboardPage.dashboardLoc.filterMonitor.tabRequest("Shared with Team")).toHaveClass(/active/);
   51 |         })
   52 |     })
   53 |
   54 |     test("DASHBOARD_003 - Verify navbar active in tablet and phone", {
   55 |         tag: ['@DASHBOARD_003', '@dashboard', '@function']
   56 |     }, async ({ browser, conf }) => {
   57 |         for (const { name, viewport } of dashboardPage.devices) {
   58 |             await test.step(`Verify navbar active in ${name}`, async () => {
   59 |                 const context = await browser.newContext({
   60 |                     viewport: viewport,
   61 |                     userAgent: name.includes('iPhone') || name.includes('iPad')
   62 |                         ? 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Mobile/15E148 Safari/604.1'
   63 |                         : 'Mozilla/5.0 (Linux; Android 11; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Mobile Safari/537.36',
   64 |                     deviceScaleFactor: name.includes('iPhone') || name.includes('iPad') ? 2 : 1,
   65 |                     isMobile: true,
   66 |                     hasTouch: true,
   67 |                 });
   68 |
   69 |                 const newPage = await context.newPage();
   70 |                 const newDashboardPage = new DashboardPage(newPage);
   71 |                 const newLoginPage = new LoginPage(newPage);
   72 |
   73 |                 await newLoginPage.open();
   74 |                 await newLoginPage.login(conf.data.username, conf.data.password);
   75 |                 await expect(newLoginPage.baseLoc.dashboardContainer).toBeVisible();
   76 |
   77 |                 await newDashboardPage.dashboardLoc.showNavBarIcon.click();
   78 |
   79 |                 const checkTabVisibility = async (tabs: any) => {
   80 |                     for (const tab of tabs) {
   81 |                         const navLink = newDashboardPage.dashboardLoc.navLink(tab.name);
   82 |                         await navLink.scrollIntoViewIfNeeded();
   83 |                         await expect(navLink).toBeVisible({ timeout: 5000 });
   84 |
   85 |                         if (tab.subTabs) {
   86 |                             await navLink.click({ force: true });
   87 |                             await newDashboardPage.waitForSecond(2);
   88 |                             for (const subTab of tab.subTabs) {
   89 |                                 const subNavLink = newDashboardPage.dashboardLoc.subNavLink(subTab);
   90 |                                 const isPresent = await subNavLink.count() > 0;
   91 |                                 if (isPresent) {
   92 |                                     await expect(subNavLink).toBeVisible({ timeout: 5000 });
   93 |                                 }
   94 |                             }
   95 |                         }
   96 |                     }
   97 |                 };
   98 |
   99 |                 await checkTabVisibility(newDashboardPage.navbarTabs.tabs);
  100 |
  101 |                 await newPage.close();
  102 |                 await context.close();
  103 |             });
  104 |         }
  105 |     });
  106 |
  107 |     test("DASHBOARD_004 - Verify all modal filter click reset not to close", {
  108 |         tag: ['@DASHBOARD_004', '@dashboard', '@function']
  109 |     }, async () => {
  110 |         const popupSuggestContacts = dashboardPage.dashboardLoc.modal.headerModal("Suggested Contacts");
  111 |         await dashboardPage.page.addLocatorHandler(popupSuggestContacts, async () => {
  112 |             await dashboardPage.dashboardLoc.buttonByText("Skip Now").click();
  113 |         });
  114 |
  115 |         for (const { name, link } of dashboardPage.pageFilter) {
  116 |             await test.step(`Verify when click reset filter in ${name} page`, async () => {
  117 |                 await dashboardPage.go(link);
  118 |                 if (link === 'contacts') {
```