Skip to content

Commit cb45b4f

Browse files
committed
Fix the test error when connect with YWinAppDriver
1 parent eb26dc8 commit cb45b4f

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

example/Pages/CalculatorPage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ class CalculatorPage extends PageObject {
1515
get clearButton() { return By2.nativeName('Clear'); }
1616
get plusButton() { return By2.nativeName('Plus'); }
1717
get divideButton() { return By2.nativeAccessibilityId('divideButton'); }
18-
get multiplyButton() { return By2.nativeXpath("//Button[@Name='Multiply by']") }
19-
get minusButton() { return By2.nativeXpath("//Button[@AutomationId=\"minusButton\"]"); }
18+
get multiplyButton() { return By2.nativeAccessibilityId("multiplyButton") }
19+
get minusButton() { return By2.nativeAccessibilityId("minusButton"); }
2020
get button0() { return By2.nativeAccessibilityId('num0Button'); }
2121
get button1() { return By2.nativeAccessibilityId('num1Button'); }
2222
get button2() { return By2.nativeAccessibilityId('num2Button'); }

example/__tests__/Calculator.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ async function getCalculatorResultText() {
2626
describe('Addition', () => {
2727
// Applies only to tests in this describe block
2828
beforeEach(() => {
29-
return By2.nativeName('Clear').clear();
29+
return By2.nativeName('Clear').click();
3030
});
3131
test('Addition', async () => {
3232
// Find the buttons by their names and click them in sequence to perform 1 + 7 = 8

example/__tests__/CalculatorWithPageObject.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe('Calulator Test', () => {
2424
// Applies only to tests in this describe block
2525
beforeEach(async () => {
2626
await CalculatorPage.waitForPageLoaded();
27-
await CalculatorPage.clearButton.clear();
27+
await CalculatorPage.clearButton.click();
2828
});
2929
test('Addition', async () => {
3030
// Find the buttons by their names and click them in sequence to perform 1 + 7 = 8

0 commit comments

Comments
 (0)