fix(promptModalComponent.spec.ts): update element locators to match changes in HTML structure

This commit is contained in:
cristhianzl 2023-10-18 15:51:56 -03:00
commit ad8183e598

View file

@ -18,13 +18,13 @@ test("PromptTemplateComponent", async ({ page }) => {
await page.mouse.up(); await page.mouse.up();
await page.mouse.down(); await page.mouse.down();
await page.locator('//*[@id="prompt-input-3"]').click(); await page.locator('//*[@id="prompt-input-4"]').click();
await page await page
.locator('//*[@id="modal-prompt-input-3"]') .locator('//*[@id="modal-prompt-input-4"]')
.fill("{prompt} example {prompt1}"); .fill("{prompt} example {prompt1}");
let value = await page let value = await page
.locator('//*[@id="modal-prompt-input-3"]') .locator('//*[@id="modal-prompt-input-4"]')
.inputValue(); .inputValue();
if (value != "{prompt} example {prompt1}") { if (value != "{prompt} example {prompt1}") {
@ -43,27 +43,27 @@ test("PromptTemplateComponent", async ({ page }) => {
await page.locator('//*[@id="genericModalBtnSave"]').click(); await page.locator('//*[@id="genericModalBtnSave"]').click();
await page.locator('//*[@id="textarea-6"]').click(); await page.locator('//*[@id="textarea-7"]').click();
await page.locator('//*[@id="textarea-6"]').fill("prompt_value_!@#!@#"); await page.locator('//*[@id="textarea-7"]').fill("prompt_value_!@#!@#");
value = await page.locator('//*[@id="textarea-6"]').inputValue(); value = await page.locator('//*[@id="textarea-7"]').inputValue();
if (value != "prompt_value_!@#!@#") { if (value != "prompt_value_!@#!@#") {
expect(false).toBeTruthy(); expect(false).toBeTruthy();
} }
await page.locator('//*[@id="textarea-7"]').click(); await page.locator('//*[@id="textarea-8"]').click();
await page await page
.locator('//*[@id="textarea-7"]') .locator('//*[@id="textarea-8"]')
.fill("prompt_name_test_123123!@#!@#"); .fill("prompt_name_test_123123!@#!@#");
value = await page.locator('//*[@id="textarea-7"]').inputValue(); value = await page.locator('//*[@id="textarea-8"]').inputValue();
if (value != "prompt_name_test_123123!@#!@#") { if (value != "prompt_name_test_123123!@#!@#") {
expect(false).toBeTruthy(); expect(false).toBeTruthy();
} }
value = await page.locator('//*[@id="prompt-input-3"]').innerText(); value = await page.locator('//*[@id="prompt-input-4"]').innerText();
if (value != "{prompt} example {prompt1}") { if (value != "{prompt} example {prompt1}") {
expect(false).toBeTruthy(); expect(false).toBeTruthy();
@ -135,7 +135,7 @@ test("PromptTemplateComponent", async ({ page }) => {
await page.locator('//*[@id="saveChangesBtn"]').click(); await page.locator('//*[@id="saveChangesBtn"]').click();
const plusButtonLocator = page.locator('//*[@id="textarea-7"]'); const plusButtonLocator = page.locator('//*[@id="textarea-8"]');
const elementCount = await plusButtonLocator.count(); const elementCount = await plusButtonLocator.count();
if (elementCount === 0) { if (elementCount === 0) {
expect(true).toBeTruthy(); expect(true).toBeTruthy();