fix(keypairListComponent): add data-testid attribute to input elements for better testability

fix(codeAreaModalComponent.spec): remove unnecessary click action
fix(floatComponent.spec): remove unnecessary click action
fix(intComponent.spec): remove unnecessary click action
fix(keyPairListComponent.spec): remove unnecessary click action
fix(promptModalComponent.spec): remove unnecessary comments and unused code
This commit is contained in:
cristhianzl 2023-12-06 20:06:47 -03:00
commit 08522720dc
6 changed files with 23 additions and 39 deletions

View file

@ -31,10 +31,6 @@ test("CodeAreaModalComponent", async ({ page }) => {
await page.locator('//*[@id="checkAndSaveBtn"]').click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[1]/div[1]/div/div[2]/div')
.click();
await page.getByTestId("genericModalBtnSave").click();
await page.getByTestId("more-options-modal").click();
await page.getByTestId("edit-button-modal").click();
@ -112,9 +108,6 @@ test("CodeAreaModalComponent", async ({ page }) => {
if (elementCount === 0) {
expect(true).toBeTruthy();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[1]/div[1]/div/div[2]/div')
.click();
await page.getByTestId("more-options-modal").click();
await page.getByTestId("edit-button-modal").click();

View file

@ -36,11 +36,6 @@ test("FloatComponent", async ({ page }) => {
expect(false).toBeTruthy();
}
await page
.locator(
'//*[@id="react-flow-id"]/div[1]/div[1]/div[1]/div/div[2]/div/div/div[1]/div/div[1]/div'
)
.click();
await page.getByTestId("more-options-modal").click();
await page.getByTestId("edit-button-modal").click();
@ -381,11 +376,6 @@ test("FloatComponent", async ({ page }) => {
if (elementCount === 0) {
expect(true).toBeTruthy();
await page
.locator(
'//*[@id="react-flow-id"]/div[1]/div[1]/div[1]/div/div[2]/div/div/div[1]/div/div[1]/div'
)
.click();
await page.getByTestId("more-options-modal").click();
await page.getByTestId("edit-button-modal").click();

View file

@ -39,9 +39,6 @@ test("IntComponent", async ({ page }) => {
expect(false).toBeTruthy();
}
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[1]/div[1]/div/div[2]/div')
.click();
await page.getByTestId("more-options-modal").click();
await page.getByTestId("edit-button-modal").click();
@ -78,9 +75,6 @@ test("IntComponent", async ({ page }) => {
if (elementCount === 0) {
expect(true).toBeTruthy();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[1]/div[1]/div/div[2]/div')
.click();
await page.getByTestId("more-options-modal").click();
await page.getByTestId("edit-button-modal").click();

View file

@ -25,9 +25,10 @@ test("KeypairListComponent", async ({ page }) => {
.locator('//*[@id="keypair100"]')
.fill("test test test test test test");
const valueWithSpace = await page
.locator('//*[@id="keypair100"]')
.inputValue();
await page.waitForTimeout(1000);
const valueWithSpace = await page.getByTestId("keypair100").inputValue();
console.log(valueWithSpace);
if (valueWithSpace !== "test test test test test test") {
expect(false).toBeTruthy();
@ -43,7 +44,7 @@ test("KeypairListComponent", async ({ page }) => {
await page.locator('//*[@id="keypair1"]').fill("testtesttesttest1");
await page.locator('//*[@id="keypair101"]').click();
await page.locator('//*[@id="keypair101"]').fill("testtesttesttesttesttest1");
await page.locator('//*[@id="plusbtn1"]').click();
await page.locator('//*[@id="plusbtn2"]').click();
await page.locator('//*[@id="keypair2"]').click();
await page.locator('//*[@id="keypair2"]').fill("testtesttesttest2");
@ -61,11 +62,6 @@ test("KeypairListComponent", async ({ page }) => {
expect(false).toBeTruthy();
}
await page
.locator(
'//*[@id="react-flow-id"]/div[1]/div[1]/div[1]/div/div[2]/div/div/div[1]/div/div[1]/div'
)
.click();
await page.getByTestId("more-options-modal").click();
await page.getByTestId("edit-button-modal").click();
@ -82,11 +78,6 @@ test("KeypairListComponent", async ({ page }) => {
if (elementCount === 0) {
expect(true).toBeTruthy();
await page
.locator(
'//*[@id="react-flow-id"]/div[1]/div[1]/div[1]/div/div[2]/div/div/div[1]/div/div[1]/div'
)
.click();
await page.getByTestId("more-options-modal").click();
await page.getByTestId("edit-button-modal").click();

View file

@ -19,12 +19,10 @@ test("PromptTemplateComponent", async ({ page }) => {
await page.mouse.down();
await page.getByTestId("prompt-input-4-ExternalLink").click();
// await page.getByTestId("edit-prompt-sanitized").click();
await page
.getByTestId("modal-prompt-input-4")
.fill("{prompt} example {prompt1}");
// await page.getByTestId("edit-prompt-sanitized").click();
let value = await page.getByTestId("modal-prompt-input-4").inputValue();