Skip to content

Commit 67b73cf

Browse files
committed
add acknowledge button
1 parent 5e03962 commit 67b73cf

File tree

2 files changed

+60
-51
lines changed

2 files changed

+60
-51
lines changed

ui-tests-starter/tst-243+/software/aws/toolkits/jetbrains/uitests/testTests/QTestGenerationChatTestScripts.kt

Lines changed: 33 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ val testHappyPathScript = """
2626
await page.keyboard.press('Enter');
2727
try {
2828
await page.evaluate(() => {
29-
const acknowledgeButton = Array.from(document.querySelectorAll('button')).find(
30-
button => button.textContent.includes('Acknowledge')
31-
);
29+
const acknowledgeButton = document.querySelector('button[action-id=amazonq-disclaimer-acknowledge-button-id]');
3230
if (acknowledgeButton) {
3331
acknowledgeButton.click();
3432
}
@@ -304,6 +302,12 @@ val testRejectPathScript = """
304302
try {
305303
await waitForElementWithText(page, "Q - Test")
306304
console.log("new tab opened")
305+
await page.evaluate(() => {
306+
const acknowledgeButton = document.querySelector('button[action-id=amazonq-disclaimer-acknowledge-button-id]');
307+
if (acknowledgeButton) {
308+
acknowledgeButton.click();
309+
}
310+
});
307311
await page.waitForFunction(
308312
() => {
309313
const button = document.querySelector('button[action-id="utg_view_diff"]');
@@ -348,15 +352,6 @@ val testRejectPathScript = """
348352
349353
console.log("Input field re-enabled after rejection")
350354
351-
await page.evaluate(() => {
352-
const acknowledgeButton = Array.from(document.querySelectorAll('button')).find(
353-
button => button.textContent.includes('Acknowledge')
354-
);
355-
if (acknowledgeButton) {
356-
acknowledgeButton.click();
357-
}
358-
});
359-
360355
const feedbackButton = await page.waitForFunction(
361356
(expectedText) => {
362357
const buttons = document.querySelectorAll('button');
@@ -553,6 +548,13 @@ val testCancelButtonScript = """
553548
try {
554549
await waitForElementWithText(page, "Q - Test")
555550
console.log("new tab opened")
551+
await page.evaluate(() => {
552+
const acknowledgeButton = document.querySelector('button[action-id=amazonq-disclaimer-acknowledge-button-id]');
553+
if (acknowledgeButton) {
554+
acknowledgeButton.click();
555+
}
556+
});
557+
556558
557559
558560
await page.waitForFunction(
@@ -599,18 +601,7 @@ val testCancelButtonScript = """
599601
);
600602
601603
console.log("Input field re-enabled after cancellation")
602-
603-
await page.evaluate(() => {
604-
const acknowledgeButton = Array.from(document.querySelectorAll('button')).find(
605-
button => button.textContent.includes('Acknowledge')
606-
);
607-
if (acknowledgeButton) {
608-
acknowledgeButton.click();
609-
}
610-
});
611-
612-
613-
604+
614605
const feedbackButton = await page.waitForFunction(
615606
(expectedText) => {
616607
const buttons = document.querySelectorAll('button');
@@ -674,6 +665,12 @@ val testDocumentationErrorScript = """
674665
await waitForElementWithText(page, "Q - Test")
675666
console.log("new tab opened")
676667
668+
await page.evaluate(() => {
669+
const acknowledgeButton = document.querySelector('button[action-id=amazonq-disclaimer-acknowledge-button-id]');
670+
if (acknowledgeButton) {
671+
acknowledgeButton.click();
672+
}
673+
});
677674
await page.waitForFunction(
678675
(expectedText) => {
679676
const pageContent = document.body.textContent || '';
@@ -696,15 +693,6 @@ val testDocumentationErrorScript = """
696693
);
697694
698695
console.log("Input field re-enabled after error")
699-
700-
await page.evaluate(() => {
701-
const acknowledgeButton = Array.from(document.querySelectorAll('button')).find(
702-
button => button.textContent.includes('Acknowledge')
703-
);
704-
if (acknowledgeButton) {
705-
acknowledgeButton.click();
706-
}
707-
});
708696
709697
const feedbackButton = await page.waitForFunction(
710698
(expectedText) => {
@@ -767,6 +755,12 @@ val testRemoveFunctionErrorScript = """
767755
try {
768756
await waitForElementWithText(page, "Q - Test")
769757
console.log("new tab opened")
758+
await page.evaluate(() => {
759+
const acknowledgeButton = document.querySelector('button[action-id=amazonq-disclaimer-acknowledge-button-id]');
760+
if (acknowledgeButton) {
761+
acknowledgeButton.click();
762+
}
763+
});
770764
771765
await page.waitForFunction(
772766
(expectedText) => {
@@ -790,15 +784,6 @@ val testRemoveFunctionErrorScript = """
790784
791785
console.log("Input field re-enabled after error")
792786
793-
await page.evaluate(() => {
794-
const acknowledgeButton = Array.from(document.querySelectorAll('button')).find(
795-
button => button.textContent.includes('Acknowledge')
796-
);
797-
if (acknowledgeButton) {
798-
acknowledgeButton.click();
799-
}
800-
});
801-
802787
const feedbackButton = await page.waitForFunction(
803788
(expectedText) => {
804789
const buttons = document.querySelectorAll('button');
@@ -860,6 +845,12 @@ val testMethodNotFoundErrorScript = """
860845
try {
861846
await waitForElementWithText(page, "Q - Test")
862847
console.log("new tab opened")
848+
await page.evaluate(() => {
849+
const acknowledgeButton = document.querySelector('button[action-id=amazonq-disclaimer-acknowledge-button-id]');
850+
if (acknowledgeButton) {
851+
acknowledgeButton.click();
852+
}
853+
});
863854
864855
await page.waitForFunction(
865856
(expectedText) => {
@@ -883,15 +874,6 @@ val testMethodNotFoundErrorScript = """
883874
884875
console.log("Input field re-enabled after error")
885876
886-
await page.evaluate(() => {
887-
const acknowledgeButton = Array.from(document.querySelectorAll('button')).find(
888-
button => button.textContent.includes('Acknowledge')
889-
);
890-
if (acknowledgeButton) {
891-
acknowledgeButton.click();
892-
}
893-
});
894-
895877
const feedbackButton = await page.waitForFunction(
896878
(expectedText) => {
897879
const buttons = document.querySelectorAll('button');
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import org.junit.Test;
2+
import static org.junit.Assert.*;
3+
4+
public class HappyPathTest {
5+
6+
/**
7+
* Tests the behavior of the multiply method with extreme large values.
8+
* This test verifies that the method can handle multiplication of very large numbers
9+
* without throwing exceptions or producing unexpected results.
10+
*/
11+
@Test
12+
public void testMultiplyWithExtremeValues() {
13+
double result = HappyPath.multiply(Double.MAX_VALUE, 2);
14+
assertTrue("Multiplication with extreme values should result in Infinity", Double.isInfinite(result));
15+
}
16+
17+
/**
18+
* Tests the multiply method with positive numbers.
19+
* Verifies that the method correctly multiplies two positive double values.
20+
*/
21+
@Test
22+
public void test_multiply_positive_numbers() {
23+
double result = HappyPath.multiply(2.5, 3.0);
24+
assertEquals(7.5, result, 0.0001);
25+
}
26+
27+
}

0 commit comments

Comments
 (0)