Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc facet playwright #2484

Merged
merged 13 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/recordset/recordset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ const RecordsetInner = ({
<div className='main-container dynamic-padding' ref={mainContainer}>
{hasSpinner &&
<div className='recordset-main-spinner-container sticky-spinner-outer-container'>
<ChaiseSpinner className='recordest-main-spinner manual-position-spinner' />
<ChaiseSpinner className='recordset-main-spinner manual-position-spinner' />
</div>
}
<div className={`main-body${hasSpinner ? ' with-spinner' : ''}`}>
Expand Down
1 change: 1 addition & 0 deletions src/custom.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ declare module '*.jpg';
declare module '*.png';
declare module '*.jpeg';
declare module '*.gif';
declare module 'chance';
declare module 'plotly.js-basic-dist-min';
declare module 'react-plotly.js/factory';
declare module 'spark-md5';
4 changes: 4 additions & 0 deletions test/e2e/locators/recordedit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,10 @@ export default class RecordeditLocators {
return RecordeditLocators.getForeignKeyInputDisplay(container, columnDisplayName, formNumber).locator('.remove-input-btn');
}

static getModalPopupButtons(container: Page | Locator): Locator {
return container.locator('.modal-popup-btn');
}


// ----------------- multi form input selectors ------------------- //

Expand Down
40 changes: 39 additions & 1 deletion test/e2e/locators/recordset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default class RecordsetLocators {
static async waitForRecordsetPageReady(container: Page | Locator, timeout?: number): Promise<void> {
await RecordsetLocators.getRecordSetTable(container).waitFor({ state: 'visible', timeout });

await container.locator('.recordest-main-spinner').waitFor({ state: 'detached', timeout });
await container.locator('.recordset-main-spinner').waitFor({ state: 'detached', timeout });
}


Expand Down Expand Up @@ -155,6 +155,24 @@ export default class RecordsetLocators {
return container.locator('tr.disabled-row');
}

static getColumnNames(container: Page | Locator): Locator {
return container.locator('.table-column-displayname > span');
};

static getFirstColumn(container: Page | Locator): Locator {
return container.locator('.chaise-table-row td:nth-child(2)');
}

// Currently only in modals but could be part of recordset in different contexts/views
static getSelectAllBtn(container: Page | Locator): Locator {
return container.locator('.table-select-all-rows')
};

/* sort selectors */
static getColumnSortButton(container: Page | Locator, rawColumnName: string): Locator {
return container.locator(`.c_${rawColumnName} .not-sorted-icon`);
};


// -------------------- row-level selectors ------------------------ //

Expand All @@ -174,6 +192,10 @@ export default class RecordsetLocators {
return container.locator('.recordset-table').locator('.chaise-checkbox input.checked');
}

static getClearSelectedRows(container: Page | Locator): Locator {
return container.locator('.clear-all-btn');
}

static getRowFirstCell(container: Page | Locator, rowIndex: number, isDisabled?: boolean): Locator {
const rows = isDisabled ? RecordsetLocators.getRows(container) : RecordsetLocators.getDisabledRows(container)
return rows.nth(rowIndex).locator('td:not(.action-btns)').first();
Expand Down Expand Up @@ -206,6 +228,14 @@ export default class RecordsetLocators {
return container.locator('.side-panel-resizable');
}

static getHideFilterPanelBtn(container: Page | Locator): Locator {
return container.locator('.hide-filter-panel-btn');
}

static getShowFilterPanelBtn(container: Page | Locator): Locator {
return container.locator('.show-filter-panel-btn');
}

static getAllFacets(container: Page | Locator): Locator {
return container.locator('.panel-group .facet-panel');
}
Expand Down Expand Up @@ -255,6 +285,14 @@ export default class RecordsetLocators {
return facet.locator('.chaise-checkbox input.checked');
}

static getDisabledFacetOptions(facet: Locator): Locator {
return facet.locator('.chaise-checkbox input[disabled]');
}

static getFacetMoreFiltersText(facet: Locator): Locator {
return facet.locator('.more-filters');
}

static getFacetOption(facet: Locator, optionIdx: number): Locator {
return facet.locator(`.checkbox-${optionIdx}`);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ test('Viewing Recordset with Faceting, default presentation based on facets anno
const mainSearch = RecordsetLocators.getMainSearchInput(page);

await RecordsetLocators.getClearAllFilters(page).click();
await page.locator('.recordest-main-spinner').waitFor({ state: 'detached' });
await page.locator('.recordset-main-spinner').waitFor({ state: 'detached' });

await mainSearch.fill(testParams.searchBox.term);
await expect.soft(RecordsetLocators.getRows(page)).toHaveCount(testParams.searchBox.numRows);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test, expect, Locator } from '@playwright/test';
import { test, expect } from '@playwright/test';

// locators
import RecordsetLocators, { TimestampDateTime } from '@isrd-isi-edu/chaise/test/e2e/locators/recordset';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ export default getConfig({
configFileName: 'recordset/ind-facet.dev.json',
mainSpecName: 'delete-prohibited',
testMatch: [
'facet-presentation.spec.ts',
'ind-facet.spec.ts',
'four-facet-selections.spec.ts',
// 'misc-facet.spec.ts'
// 'facet-presentation.spec.ts',
// 'ind-facet.spec.ts',
// 'four-facet-selections.spec.ts',
'misc-facet.spec.ts'
]
});
Loading
Loading