test: remove unintended awaits

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
This commit is contained in:
Raju Udava
2023-09-01 10:10:26 +05:30
parent 6e2a05db7e
commit eddd118280
40 changed files with 175 additions and 209 deletions

View File

@@ -19,7 +19,7 @@ export class ImportTemplatePage extends BasePage {
async getImportTableList() {
await this.get().locator(`.ant-collapse-header`).nth(0).waitFor();
const tr = await this.get().locator(`.ant-collapse-header`);
const tr = this.get().locator(`.ant-collapse-header`);
const rowCount = await tr.count();
const tableList: string[] = [];
for (let i = 0; i < rowCount; i++) {
@@ -32,7 +32,7 @@ export class ImportTemplatePage extends BasePage {
async getImportColumnList() {
// return an array
const columnList: { type: string; name: string }[] = [];
const tr = await this.get().locator(`tr.ant-table-row-level-0:visible`);
const tr = this.get().locator(`tr.ant-table-row-level-0:visible`);
const rowCount = await tr.count();
for (let i = 0; i < rowCount; i++) {
// replace \n and \t from innerText
@@ -51,9 +51,9 @@ export class ImportTemplatePage extends BasePage {
const tblList = await this.getImportTableList();
for (let i = 0; i < result.length; i++) {
await expect(tblList[i]).toBe(result[i].name);
expect(tblList[i]).toBe(result[i].name);
const columnList = await this.getImportColumnList();
await expect(columnList).toEqual(result[i].columns);
expect(columnList).toEqual(result[i].columns);
if (i < result.length - 1) {
await this.expandTableList({ index: i + 1 });
}