@@ -11,7 +11,7 @@ val testHappyPathScript = """
11
11
const browser = await puppeteer.connect({
12
12
browserURL: "http://localhost:9222"
13
13
})
14
- try {
14
+ try {
15
15
const pages = await browser.pages()
16
16
for(const page of pages) {
17
17
const contents = await page.evaluate(el => el.innerHTML, await page.${' $' } (':root'));
@@ -24,7 +24,15 @@ val testHappyPathScript = """
24
24
await page.type('.mynah-chat-prompt-input', '/test')
25
25
await page.keyboard.press('Enter');
26
26
await page.keyboard.press('Enter');
27
- try {
27
+ try {
28
+ await page.evaluate(() => {
29
+ const acknowledgeButton = Array.from(document.querySelectorAll('button')).find(
30
+ button => button.textContent.includes('Acknowledge')
31
+ );
32
+ if (acknowledgeButton) {
33
+ acknowledgeButton.click();
34
+ }
35
+ });
28
36
await waitForElementWithText(page, "Q - Test")
29
37
console.log("new tab opened")
30
38
await page.waitForFunction(
@@ -71,14 +79,7 @@ val testHappyPathScript = """
71
79
72
80
console.log("Input field re-enabled after acceptance")
73
81
74
- await page.evaluate(() => {
75
- const acknowledgeButton = Array.from(document.querySelectorAll('button')).find(
76
- button => button.textContent.trim() === 'Acknowledge'
77
- );
78
- if (acknowledgeButton) {
79
- acknowledgeButton.click();
80
- }
81
- });
82
+
82
83
83
84
84
85
@@ -349,7 +350,7 @@ val testRejectPathScript = """
349
350
350
351
await page.evaluate(() => {
351
352
const acknowledgeButton = Array.from(document.querySelectorAll('button')).find(
352
- button => button.textContent.trim() === 'Acknowledge'
353
+ button => button.textContent.includes( 'Acknowledge')
353
354
);
354
355
if (acknowledgeButton) {
355
356
acknowledgeButton.click();
@@ -601,7 +602,7 @@ val testCancelButtonScript = """
601
602
602
603
await page.evaluate(() => {
603
604
const acknowledgeButton = Array.from(document.querySelectorAll('button')).find(
604
- button => button.textContent.trim() === 'Acknowledge'
605
+ button => button.textContent.includes( 'Acknowledge')
605
606
);
606
607
if (acknowledgeButton) {
607
608
acknowledgeButton.click();
@@ -698,7 +699,7 @@ val testDocumentationErrorScript = """
698
699
699
700
await page.evaluate(() => {
700
701
const acknowledgeButton = Array.from(document.querySelectorAll('button')).find(
701
- button => button.textContent.trim() === 'Acknowledge'
702
+ button => button.textContent.includes( 'Acknowledge')
702
703
);
703
704
if (acknowledgeButton) {
704
705
acknowledgeButton.click();
@@ -791,7 +792,7 @@ val testRemoveFunctionErrorScript = """
791
792
792
793
await page.evaluate(() => {
793
794
const acknowledgeButton = Array.from(document.querySelectorAll('button')).find(
794
- button => button.textContent.trim() === 'Acknowledge'
795
+ button => button.textContent.includes( 'Acknowledge')
795
796
);
796
797
if (acknowledgeButton) {
797
798
acknowledgeButton.click();
@@ -884,7 +885,7 @@ val testMethodNotFoundErrorScript = """
884
885
885
886
await page.evaluate(() => {
886
887
const acknowledgeButton = Array.from(document.querySelectorAll('button')).find(
887
- button => button.textContent.trim() === 'Acknowledge'
888
+ button => button.textContent.includes( 'Acknowledge')
888
889
);
889
890
if (acknowledgeButton) {
890
891
acknowledgeButton.click();
0 commit comments