UNPKG

@umbraco/playwright-testhelpers

Version:

Test helpers for making playwright tests for Umbraco solutions

38 lines 1.67 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ExamineManagementUiHelper = void 0; const test_1 = require("@playwright/test"); const UiBaseLocators_1 = require("./UiBaseLocators"); class ExamineManagementUiHelper extends UiBaseLocators_1.UiBaseLocators { examineManagementTab; indexersContent; indexerItems; indexInfoRow; constructor(page) { super(page); this.examineManagementTab = page.getByRole('tab', { name: 'Examine Management' }); this.indexersContent = page.locator('[headline="Indexers"]'); this.indexerItems = this.indexersContent.locator('uui-table-cell a'); this.indexInfoRow = page.locator('uui-table-row'); } async clickExamineManagementTab() { await this.examineManagementTab.click(); } async doesIndexersHaveText(text) { return await (0, test_1.expect)(this.indexersContent).toContainText(text); } checkIndexersCount() { return this.indexerItems.count(); } async clickIndexByName(indexName) { await this.page.getByRole('link', { name: indexName }).click(); } async doesIndexPropertyHaveValue(indexProperty, indexValue) { return (0, test_1.expect)(this.indexInfoRow.filter({ has: this.page.getByText(indexProperty) }).getByRole('cell').last()).toHaveText(indexValue); } async doesIndexHaveHealthStatus(indexName, status) { return (0, test_1.expect)(this.page.locator("[headline='" + indexName + "']").getByText(status)).toBeVisible(); } } exports.ExamineManagementUiHelper = ExamineManagementUiHelper; //# sourceMappingURL=ExamineManagementUiHelper.js.map