Skip to content

Commit

Permalink
tests linter
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyNenashev committed Oct 24, 2023
1 parent 6de4d4e commit 7d229bf
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const SingleFilter = <OptionType extends DataSource | Namespace | ActivityEventT
sx={{ mt: 2 }}
label={name}
id={`filter-${filterName}`}
value={queryParams[filterName] || defaultOption}
value={queryParams[filterName] ?? defaultOption}
dataQAId={dataQA}
>
<AppMenuItem value='All' onClick={handleFilterSelect(defaultOption)}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,18 @@ const AppSelect: React.FC<AppSelectProps> = React.forwardRef(
<Grid
sx={props.containerSx || { mt: label ? 2 : 0, width: fullWidth ? '100%' : 'auto' }}
>
{label && <S.SelectLabel htmlFor={id}>{label}</S.SelectLabel>}
{label && (
<S.SelectLabel id={`${id}-label`} htmlFor={id}>
{label}
</S.SelectLabel>
)}
<S.AppSelect
{...props}
$size={size}
$isLabeled={!!label}
variant='outlined'
fullWidth={fullWidth}
labelId={`${id}-label`}
IconComponent={DropdownIcon}
notched
ref={ref}
Expand Down
14 changes: 7 additions & 7 deletions tests/features/filters/filters.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { expect } from '@playwright/test';
import { test } from '../../config/test-base';

const datasourceFilter = 'Datasource';
const namespaceFilter = 'Namespace';
const datasourcesFilter = 'Datasources';
const namespacesFilter = 'Namespaces';
const ownerFilter = 'Owner';
const typeFilter = 'Type';
const tagFilter = 'Tag';
Expand All @@ -29,7 +29,7 @@ test.describe('Check filters', () => {
steps: { pages },
}) => {
await test.step('Apply filter Datasource', async () => {
await pages.catalog.openFilterWithSelect(datasourceFilter);
await pages.catalog.openFilterWithSelect(datasourcesFilter);

Check failure on line 32 in tests/features/filters/filters.spec.ts

View workflow job for this annotation

GitHub Actions / run_playwright_tests / test

[chromium] › ../features/filters/filters.spec.ts:28:5 › Check filters › When apply single filter › Should display the expected item with Datasource filter

1) [chromium] › ../features/filters/filters.spec.ts:28:5 › Check filters › When apply single filter › Should display the expected item with Datasource filter locator.click: Error while parsing selector "#filter-datasources-label)" 30 | }) => { 31 | await test.step('Apply filter Datasource', async () => { > 32 | await pages.catalog.openFilterWithSelect(datasourcesFilter); | ^ 33 | await pages.catalog.chooseOption(datasourceOptionBookETL); 34 | expect(await pages.catalog.isListItemVisible(bookETLDataEntity)).toBeTruthy(); 35 | }); at CatalogPage.openFilterWithSelect (/home/runner/work/odd-platform/odd-platform/tests/ui/pages/catalog/catalog.page.ts:40:69) at /home/runner/work/odd-platform/odd-platform/tests/features/filters/filters.spec.ts:32:29 at /home/runner/work/odd-platform/odd-platform/tests/features/filters/filters.spec.ts:31:18

Check failure on line 32 in tests/features/filters/filters.spec.ts

View workflow job for this annotation

GitHub Actions / run_playwright_tests / test

[chromium] › ../features/filters/filters.spec.ts:28:5 › Check filters › When apply single filter › Should display the expected item with Datasource filter

1) [chromium] › ../features/filters/filters.spec.ts:28:5 › Check filters › When apply single filter › Should display the expected item with Datasource filter Retry #1 --------------------------------------------------------------------------------------- locator.click: Error while parsing selector "#filter-datasources-label)" 30 | }) => { 31 | await test.step('Apply filter Datasource', async () => { > 32 | await pages.catalog.openFilterWithSelect(datasourcesFilter); | ^ 33 | await pages.catalog.chooseOption(datasourceOptionBookETL); 34 | expect(await pages.catalog.isListItemVisible(bookETLDataEntity)).toBeTruthy(); 35 | }); at CatalogPage.openFilterWithSelect (/home/runner/work/odd-platform/odd-platform/tests/ui/pages/catalog/catalog.page.ts:40:69) at /home/runner/work/odd-platform/odd-platform/tests/features/filters/filters.spec.ts:32:29 at /home/runner/work/odd-platform/odd-platform/tests/features/filters/filters.spec.ts:31:18
await pages.catalog.chooseOption(datasourceOptionBookETL);
expect(await pages.catalog.isListItemVisible(bookETLDataEntity)).toBeTruthy();
});
Expand All @@ -39,7 +39,7 @@ test.describe('Check filters', () => {
*/
test('Should display the expected item with Namespace filter', async ({ steps: { pages } }) => {
await test.step('Apply filter Namespace', async () => {
await pages.catalog.openFilterWithSelect(namespaceFilter);
await pages.catalog.openFilterWithSelect(namespacesFilter);

Check failure on line 42 in tests/features/filters/filters.spec.ts

View workflow job for this annotation

GitHub Actions / run_playwright_tests / test

[chromium] › ../features/filters/filters.spec.ts:40:5 › Check filters › When apply single filter › Should display the expected item with Namespace filter

2) [chromium] › ../features/filters/filters.spec.ts:40:5 › Check filters › When apply single filter › Should display the expected item with Namespace filter locator.click: Error while parsing selector "#filter-namespaces-label)" 40 | test('Should display the expected item with Namespace filter', async ({ steps: { pages } }) => { 41 | await test.step('Apply filter Namespace', async () => { > 42 | await pages.catalog.openFilterWithSelect(namespacesFilter); | ^ 43 | await pages.catalog.chooseOption(namespaceOption); 44 | expect(await pages.catalog.isListItemVisible(bookETLDataEntity)).toBeTruthy(); 45 | }); at CatalogPage.openFilterWithSelect (/home/runner/work/odd-platform/odd-platform/tests/ui/pages/catalog/catalog.page.ts:40:69) at /home/runner/work/odd-platform/odd-platform/tests/features/filters/filters.spec.ts:42:29 at /home/runner/work/odd-platform/odd-platform/tests/features/filters/filters.spec.ts:41:18

Check failure on line 42 in tests/features/filters/filters.spec.ts

View workflow job for this annotation

GitHub Actions / run_playwright_tests / test

[chromium] › ../features/filters/filters.spec.ts:40:5 › Check filters › When apply single filter › Should display the expected item with Namespace filter

2) [chromium] › ../features/filters/filters.spec.ts:40:5 › Check filters › When apply single filter › Should display the expected item with Namespace filter Retry #1 --------------------------------------------------------------------------------------- locator.click: Error while parsing selector "#filter-namespaces-label)" 40 | test('Should display the expected item with Namespace filter', async ({ steps: { pages } }) => { 41 | await test.step('Apply filter Namespace', async () => { > 42 | await pages.catalog.openFilterWithSelect(namespacesFilter); | ^ 43 | await pages.catalog.chooseOption(namespaceOption); 44 | expect(await pages.catalog.isListItemVisible(bookETLDataEntity)).toBeTruthy(); 45 | }); at CatalogPage.openFilterWithSelect (/home/runner/work/odd-platform/odd-platform/tests/ui/pages/catalog/catalog.page.ts:40:69) at /home/runner/work/odd-platform/odd-platform/tests/features/filters/filters.spec.ts:42:29 at /home/runner/work/odd-platform/odd-platform/tests/features/filters/filters.spec.ts:41:18
await pages.catalog.chooseOption(namespaceOption);
expect(await pages.catalog.isListItemVisible(bookETLDataEntity)).toBeTruthy();
});
Expand Down Expand Up @@ -113,7 +113,7 @@ test.describe('Check filters', () => {
const ownerName2 = `ownerName2${workerId}`;
const ownerTitle2 = `ownerTitle2${workerId}`;
await test.step('Apply filter Namespace', async () => {
await pages.catalog.openFilterWithSelect(namespaceFilter);
await pages.catalog.openFilterWithSelect(namespacesFilter);

Check failure on line 116 in tests/features/filters/filters.spec.ts

View workflow job for this annotation

GitHub Actions / run_playwright_tests / test

[chromium] › ../features/filters/filters.spec.ts:109:5 › Check filters › Apply multiple filters › Should display the expected item with different types of filters

3) [chromium] › ../features/filters/filters.spec.ts:109:5 › Check filters › Apply multiple filters › Should display the expected item with different types of filters locator.click: Error while parsing selector "#filter-namespaces-label)" 114 | const ownerTitle2 = `ownerTitle2${workerId}`; 115 | await test.step('Apply filter Namespace', async () => { > 116 | await pages.catalog.openFilterWithSelect(namespacesFilter); | ^ 117 | await pages.catalog.chooseOption(namespaceOption); 118 | expect(await pages.catalog.isListItemVisible(bookETLDataEntity)).toBeTruthy(); 119 | }); at CatalogPage.openFilterWithSelect (/home/runner/work/odd-platform/odd-platform/tests/ui/pages/catalog/catalog.page.ts:40:69) at /home/runner/work/odd-platform/odd-platform/tests/features/filters/filters.spec.ts:116:29 at /home/runner/work/odd-platform/odd-platform/tests/features/filters/filters.spec.ts:115:18

Check failure on line 116 in tests/features/filters/filters.spec.ts

View workflow job for this annotation

GitHub Actions / run_playwright_tests / test

[chromium] › ../features/filters/filters.spec.ts:109:5 › Check filters › Apply multiple filters › Should display the expected item with different types of filters

3) [chromium] › ../features/filters/filters.spec.ts:109:5 › Check filters › Apply multiple filters › Should display the expected item with different types of filters Retry #1 --------------------------------------------------------------------------------------- locator.click: Error while parsing selector "#filter-namespaces-label)" 114 | const ownerTitle2 = `ownerTitle2${workerId}`; 115 | await test.step('Apply filter Namespace', async () => { > 116 | await pages.catalog.openFilterWithSelect(namespacesFilter); | ^ 117 | await pages.catalog.chooseOption(namespaceOption); 118 | expect(await pages.catalog.isListItemVisible(bookETLDataEntity)).toBeTruthy(); 119 | }); at CatalogPage.openFilterWithSelect (/home/runner/work/odd-platform/odd-platform/tests/ui/pages/catalog/catalog.page.ts:40:69) at /home/runner/work/odd-platform/odd-platform/tests/features/filters/filters.spec.ts:116:29 at /home/runner/work/odd-platform/odd-platform/tests/features/filters/filters.spec.ts:115:18
await pages.catalog.chooseOption(namespaceOption);
expect(await pages.catalog.isListItemVisible(bookETLDataEntity)).toBeTruthy();
});
Expand All @@ -137,11 +137,11 @@ test.describe('Check filters', () => {
const ownerName3 = `ownerName3${workerId}`;
const ownerTitle3 = `ownerTitle3${workerId}`;
await test.step('Apply filter Datasource', async () => {
await pages.catalog.openFilterWithSelect(datasourceFilter);
await pages.catalog.openFilterWithSelect(datasourcesFilter);

Check failure on line 140 in tests/features/filters/filters.spec.ts

View workflow job for this annotation

GitHub Actions / run_playwright_tests / test

[chromium] › ../features/filters/filters.spec.ts:133:5 › Check filters › Apply multiple filters › Should display the expected item with all filters

4) [chromium] › ../features/filters/filters.spec.ts:133:5 › Check filters › Apply multiple filters › Should display the expected item with all filters locator.click: Error while parsing selector "#filter-datasources-label)" 138 | const ownerTitle3 = `ownerTitle3${workerId}`; 139 | await test.step('Apply filter Datasource', async () => { > 140 | await pages.catalog.openFilterWithSelect(datasourcesFilter); | ^ 141 | await pages.catalog.chooseOption(datasourceOptionBookETL); 142 | }); 143 | await test.step('Apply filter Namespace', async () => { at CatalogPage.openFilterWithSelect (/home/runner/work/odd-platform/odd-platform/tests/ui/pages/catalog/catalog.page.ts:40:69) at /home/runner/work/odd-platform/odd-platform/tests/features/filters/filters.spec.ts:140:29 at /home/runner/work/odd-platform/odd-platform/tests/features/filters/filters.spec.ts:139:18

Check failure on line 140 in tests/features/filters/filters.spec.ts

View workflow job for this annotation

GitHub Actions / run_playwright_tests / test

[chromium] › ../features/filters/filters.spec.ts:133:5 › Check filters › Apply multiple filters › Should display the expected item with all filters

4) [chromium] › ../features/filters/filters.spec.ts:133:5 › Check filters › Apply multiple filters › Should display the expected item with all filters Retry #1 --------------------------------------------------------------------------------------- locator.click: Error while parsing selector "#filter-datasources-label)" 138 | const ownerTitle3 = `ownerTitle3${workerId}`; 139 | await test.step('Apply filter Datasource', async () => { > 140 | await pages.catalog.openFilterWithSelect(datasourcesFilter); | ^ 141 | await pages.catalog.chooseOption(datasourceOptionBookETL); 142 | }); 143 | await test.step('Apply filter Namespace', async () => { at CatalogPage.openFilterWithSelect (/home/runner/work/odd-platform/odd-platform/tests/ui/pages/catalog/catalog.page.ts:40:69) at /home/runner/work/odd-platform/odd-platform/tests/features/filters/filters.spec.ts:140:29 at /home/runner/work/odd-platform/odd-platform/tests/features/filters/filters.spec.ts:139:18
await pages.catalog.chooseOption(datasourceOptionBookETL);
});
await test.step('Apply filter Namespace', async () => {
await pages.catalog.openFilterWithSelect(namespaceFilter);
await pages.catalog.openFilterWithSelect(namespacesFilter);
await pages.catalog.chooseOption(namespaceOption);
});
await test.step('Apply filter Owner', async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/pages/catalog/catalog.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import TextBox from '../../elements/text-box';
import BasePage from '../base-page';

const SELECTORS = {
filterWithSelect: filterName => `#filter-${filterName.toLowerCase()}:has-text('${filterName}') >> ..`,
filterWithSelect: filterName => `#filter-${filterName.toLowerCase()}-label) >> ..`,
filterWithInput: filterName => `label:text-is("${filterName}") >> ..`,
searchBar: `[placeholder="Search"]`,
cleanSearchBarButton: `[data-qa="search_string"] >> .. >> button path[fill-rule="evenodd"]`,
Expand Down

0 comments on commit 7d229bf

Please sign in to comment.