Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
16 changes: 16 additions & 0 deletions lib/helpers/ContentUiHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ export class ContentUiHelper extends UiBaseLocators {
private readonly refListBlock: Locator;
private readonly propertyActionMenu: Locator;
private readonly documentCreateOptionsModal: Locator;
private readonly listViewCustomRows: Locator;

constructor(page: Page) {
super(page);
Expand Down Expand Up @@ -353,6 +354,8 @@ export class ContentUiHelper extends UiBaseLocators {
this.memberPickerSearchTxt = this.page.locator('umb-member-picker-modal #input');
// Property Actions
this.propertyActionMenu = page.locator('#property-action-popover umb-popover-layout');
// List view custom
this.listViewCustomRows = page.locator('table tbody tr');
}

async enterContentName(name: string) {
Expand Down Expand Up @@ -1753,4 +1756,17 @@ export class ContentUiHelper extends UiBaseLocators {
async doesDocumentModalHaveText(text: string) {
await expect(this.documentCreateOptionsModal).toContainText(text);
}

async doesListViewItemsHaveCount(pageSize: number){
await expect(this.listViewCustomRows).toHaveCount(pageSize);
}

async isListViewItemWithNameVisible(itemName: string, index: number = 0){
await expect(this.listViewCustomRows.nth(index)).toContainText(itemName);
}

async clickPaginationNextButton(){
await expect(this.nextBtn).toBeVisible();
await this.nextBtn.click();
}
}
26 changes: 26 additions & 0 deletions lib/helpers/DataTypeApiHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1219,6 +1219,32 @@ export class DataTypeApiHelper {
return await this.save(dataType);
}

async createListViewContentDataTypeWithLayoutAndPageSize(name: string = 'List View - Content Test', layoutAlias: string = 'Umb.CollectionView.Document.Table', layoutName: string = 'List', pageSize: number = 100 ) {
await this.ensureNameNotExists(name);

const dataType = new ListViewDataTypeBuilder()
.withName(name)
.withPageSize(pageSize)
.withOrderDirection('asc')
.addLayout()
.withName(layoutName)
.withIcon('icon-list')
.withCollectionView(layoutAlias)
.done()
.addColumnDisplayedProperty()
.withAlias('updateDate')
.withHeader('Last edited')
.withIsSystem(true)
.done()
.addColumnDisplayedProperty()
.withAlias('creator')
.withHeader('Updated by')
.withIsSystem(true)
.done()
.build();
return await this.save(dataType);
}

async createListViewContentDataTypeWithAllPermissions(name: string = 'List View - Content Test') {
await this.ensureNameNotExists(name);

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@umbraco/playwright-testhelpers",
"version": "16.0.56",
"version": "16.0.57",
"description": "Test helpers for making playwright tests for Umbraco solutions",
"main": "dist/lib/index.js",
"files": [
Expand Down