Skip to content

Commit a48c2f0

Browse files
author
Krzysztof Wojnar
committed
chore(e2e): getBackButton replaced with tapUIBarBackButton
1 parent c73b277 commit a48c2f0

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

FabricExample/e2e/component-objects/back-button.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import semverCoerce from 'semver/functions/coerce';
55

66
const backButtonElement = element(by.id('BackButton'));
77

8-
export async function getBackButton() {
8+
export async function tapUIBarBackButton() {
99
const platform = device.getPlatform();
1010
if (platform === 'ios') {
11-
return getIOSBackButton();
11+
return (await getIOSBackButton()).tap();
1212
} else if (platform === 'android') {
13-
return backButtonElement;
13+
return backButtonElement.tap();
1414
} else throw new Error(`Platform "${platform}" not supported`);
1515
}
1616
async function getIOSBackButton() {

FabricExample/e2e/issuesTests/Test2926.e2e.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { device, expect, element, by } from 'detox';
22
import { describeIfiOS, selectTestScreen } from '../e2e-utils';
3-
import { getBackButton } from '../component-objects/back-button';
3+
import { tapUIBarBackButton } from '../component-objects/back-button';
44

55
// PR related to iOS search bar
66
describeIfiOS('Test2926', () => {
@@ -27,7 +27,7 @@ describeIfiOS('Test2926', () => {
2727
await element(by.type('UISearchBarTextField')).replaceText('Item 2');
2828
await element(by.id('home-button-open-second')).tap();
2929

30-
await (await getBackButton()).tap();
30+
await tapUIBarBackButton();
3131

3232
await expect(element(by.type('UISearchBarTextField'))).toBeVisible();
3333
await expect(element(by.type('UISearchBarTextField'))).toHaveText('Item 2');

FabricExample/e2e/issuesTests/Test432.e2e.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { device, expect, element, by } from 'detox';
22
import { selectTestScreen } from '../e2e-utils';
3-
import { getBackButton } from '../component-objects/back-button';
3+
import { tapUIBarBackButton } from '../component-objects/back-button';
44

55
describe('Test432', () => {
66
beforeAll(async () => {
@@ -27,7 +27,7 @@ describe('Test432', () => {
2727
await expect(element(by.id('details-headerRight-red'))).toBeVisible(100);
2828

2929
if (device.getPlatform() === 'ios') {
30-
await (await getBackButton()).tap();
30+
await tapUIBarBackButton();
3131
} else {
3232
await device.pressBack();
3333
}
@@ -48,7 +48,7 @@ describe('Test432', () => {
4848
waitFor(element(by.id('info-headerRight-green-1'))).toBeVisible(100);
4949

5050
if (device.getPlatform() === 'ios') {
51-
await (await getBackButton()).tap();
51+
await tapUIBarBackButton();
5252
} else {
5353
await device.pressBack();
5454
}

FabricExample/e2e/issuesTests/Test528.e2e.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { device, expect, element, by } from 'detox';
22
import { describeIfiOS, selectTestScreen } from '../e2e-utils';
3-
import { getBackButton } from '../component-objects/back-button';
3+
import { tapUIBarBackButton } from '../component-objects/back-button';
44

55
// Detox currently supports orientation only on iOS
66
describeIfiOS('Test528', () => {
@@ -24,7 +24,7 @@ describeIfiOS('Test528', () => {
2424
await element(by.text('Go to Screen 2')).tap();
2525
await device.setOrientation('landscape');
2626

27-
await (await getBackButton()).tap();
27+
await tapUIBarBackButton();
2828
await expect(element(by.text('Custom Button'))).toBeVisible(100);
2929
await device.setOrientation('portrait');
3030
await expect(element(by.text('Custom Button'))).toBeVisible(100);

0 commit comments

Comments
 (0)