Skip to content

Commit

Permalink
LPD-29194 SF
Browse files Browse the repository at this point in the history
  • Loading branch information
chestofwonders authored and brianchandotcom committed Aug 23, 2024
1 parent cd4cd14 commit 153b665
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class FiltersPage {
readonly page: Page;
readonly searchInput: Locator;
readonly searchButton: Locator;

constructor(page: Page) {
this.dataSetPage = new DataSetPage(page);
this.filterTable = page.getByRole('table');
Expand Down Expand Up @@ -322,7 +322,8 @@ export class FiltersPage {

if (preselectedValues.length) {
await this.page
.getByRole('option', {name: preselectedValues[0]}).waitFor();
.getByRole('option', {name: preselectedValues[0]})
.waitFor();

await this.page
.getByRole('option', {name: preselectedValues[0]})
Expand All @@ -333,7 +334,7 @@ export class FiltersPage {
.filter({hasText: filterMode})
.click();
}

await this.page.getByText(selectionType).click();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

import {expect, mergeTests} from '@playwright/test';
import {v4 as uuidv4} from 'uuid';

import {featureFlagsTest} from '../../../../fixtures/featureFlagsTest';
import {loginTest} from '../../../../fixtures/loginTest';
Expand All @@ -13,7 +14,6 @@ import {dataSetManagerApiHelpersTest} from '../../fixtures/dataSetManagerApiHelp
import {picklistApiHelpersTest} from '../../fixtures/picklistApiHelpersTest';
import {dataSetManagerSetupTest} from './fixtures/dataSetManagerSetupTest';
import {filtersPageTest} from './fixtures/filtersPageTest';
import {v4 as uuidv4} from 'uuid';

const SELECTION_API_HEADLESS_FILTER_NAME = 'Selection API Headless filter';
const SELECTION_PICKLIST_FILTER_NAME = 'Selection Picklist filter';
Expand Down Expand Up @@ -105,14 +105,14 @@ test.describe('Filters in Data Set Manager', () => {
await filtersPage.saveAddFilterModal();
});

await test.step('Check that the selection filter is in the list', async () => {
await expect(
page.getByRole('cell', {
exact: true,
name: SELECTION_PICKLIST_FILTER_NAME,
})
).toBeVisible();
});
await test.step('Check that the selection filter is in the list', async () => {
await expect(
page.getByRole('cell', {
exact: true,
name: SELECTION_PICKLIST_FILTER_NAME,
})
).toBeVisible();
});

await test.step('Create a selection filter from picklist source without preselected values', async () => {
await filtersPage.createSelectionFilterPicklist({
Expand All @@ -138,7 +138,9 @@ test.describe('Filters in Data Set Manager', () => {

await test.step('Can search for a filter', async () => {
await filtersPage.searchInput.click();
await filtersPage.searchInput.fill(SELECTION_PICKLIST_NO_PRESELECTED_VALUES_FILTER_NAME);
await filtersPage.searchInput.fill(
SELECTION_PICKLIST_NO_PRESELECTED_VALUES_FILTER_NAME
);

await filtersPage.searchButton.click();

Expand All @@ -147,8 +149,7 @@ test.describe('Filters in Data Set Manager', () => {
exact: true,
name: SELECTION_PICKLIST_FILTER_NAME,
})
).not
.toBeVisible();
).not.toBeVisible();

await expect(
page.getByRole('cell', {
Expand Down Expand Up @@ -177,7 +178,9 @@ test.describe('Filters in Data Set Manager', () => {

await deleteButton.click();

const cancelDeleteButton = page.getByRole('button', {name: 'Cancel'});
const cancelDeleteButton = page.getByRole('button', {
name: 'Cancel',
});

await cancelDeleteButton.waitFor();

Expand Down Expand Up @@ -207,7 +210,9 @@ test.describe('Filters in Data Set Manager', () => {

await deleteButton.click();

const confirmDeleteButton = page.getByRole('button', {name: 'Delete'});
const confirmDeleteButton = page.getByRole('button', {
name: 'Delete',
});

await confirmDeleteButton.waitFor();

Expand Down Expand Up @@ -305,12 +310,10 @@ test.describe('Filters in Data Set Manager', () => {
});

await test.step('Check that the preselected value is checked', async () => {
await page.getByLabel(
'Preselected Values'
).click();
await page.getByLabel('Preselected Values').click();

await expect(
page.getByLabel(PICKLIST_VALUE_NAME, { exact: true })
page.getByLabel(PICKLIST_VALUE_NAME, {exact: true})
).toBeChecked();
});
});
Expand Down

0 comments on commit 153b665

Please sign in to comment.