Skip to content

Commit 3e50ca0

Browse files
Fixed primary , optional key and template variable issue #20
1 parent c4c0619 commit 3e50ca0

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

tests/RPM/utils/uploadDataStructureFunctions.js

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ async function uploadDataStructure(page, titleName) {
269269
await page.locator('textarea[id=description]').fill('Test data structure');
270270

271271
// Click on make a part of primary key
272-
await page.click('text=Mark a part of primary key');
272+
await page.click('xpath=//*[@id="0"]/div[2]/div[1]/div[2]/label/div');
273273

274274
// Click on save button
275275
await page.click('#save');
@@ -356,21 +356,27 @@ async function editDataStructure(page) {
356356
// Wait for 500 milliseconds
357357
await page.waitForTimeout(500);
358358

359-
// Click on make a part of primary key
360-
await page.click('text=Value can be optional');
359+
// Click on optional value
360+
await page.click('xpath=//*[@id="0"]/div[2]/div[2]/div[2]/label/div');
361361

362-
// Click the on data type dropdown
363-
await page.click('div.value-container.svelte-u3g5ju > input.svelte-u3g5ju');
364-
await page.waitForTimeout(500);
365-
const dataType = await page.waitForSelector('.list-item .item:text("number")', { visible: true, enabled: true });
366-
await dataType.click()
362+
// Click the on template data dropdown
363+
await page.click('#variableTemplate');
364+
await page.waitForTimeout(500);
365+
const template = await page.waitForSelector('.list-item .item:text("percentage")', { visible: true, enabled: true });
366+
await template.click()
367367

368-
// Click the on unit dropdown
369-
await page.click('div.value-container.svelte-u3g5ju > input#unit');
370-
await page.waitForTimeout(500);
371-
const unit = await page.waitForSelector('.list-item .item:text("cm")', { visible: true, enabled: true });
372-
await unit.click()
373-
await page.waitForTimeout(500);
368+
// Click the on data type dropdown
369+
await page.click('#dataType');
370+
await page.waitForTimeout(500);
371+
const dataType = await page.waitForSelector('.list-item .item:text("number")', { visible: true, enabled: true });
372+
await dataType.click()
373+
374+
// Click the on unit dropdown
375+
await page.click('#unit');
376+
await page.waitForTimeout(500);
377+
const unit = await page.waitForSelector('.list-item .item:text("%")', { visible: true, enabled: true });
378+
await unit.click()
379+
await page.waitForTimeout(500);
374380

375381
// Click on save button
376382
await page.locator('button[title="save"]').click();
@@ -414,4 +420,4 @@ module.exports = {
414420
findEditedDataStructure,
415421
checkUploadDataStructure
416422

417-
};
423+
};

0 commit comments

Comments
 (0)