Skip to content

Commit

Permalink
[Example@test] Change: Add import detox, beforeAll, remove waitFor
Browse files Browse the repository at this point in the history
  • Loading branch information
guhungry committed Feb 29, 2024
1 parent da8c107 commit e0eb0f4
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 26 deletions.
10 changes: 7 additions & 3 deletions example/e2e/testCases/batchTest.spec.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
/* global device, element, by */
import { by, device, element, expect } from 'detox';

describe('batch', () => {
beforeAll(async () => {
await device.launchApp({ newInstance: true });
});

it('should load images after batch', async () => {
await expect(element(by.id('example-exampleBatch'))).toExist();

await waitFor(element(by.id('batchResult'))).toExist().withTimeout(2000);
await waitFor(element(by.id('batchResultPng'))).toExist().withTimeout(2000);
await expect(element(by.id('batchResult'))).toExist();
await expect(element(by.id('batchResultPng'))).toExist();
});
});
12 changes: 8 additions & 4 deletions example/e2e/testCases/cropTest.spec.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
/* global device, element, by */
import { by, device, element, expect } from 'detox';

describe('crop', () => {
beforeAll(async () => {
await device.launchApp({ newInstance: true });
});

it('should load images after crop', async () => {
await expect(element(by.id('example-exampleCrop'))).toExist();

await waitFor(element(by.id('cropResult'))).toExist().withTimeout(2000);
await waitFor(element(by.id('cropResizeResult'))).toExist().withTimeout(2000);
await waitFor(element(by.id('cropPngResult'))).toExist().withTimeout(2000);
await expect(element(by.id('cropResult'))).toExist();
await expect(element(by.id('cropResizeResult'))).toExist();
await expect(element(by.id('cropPngResult'))).toExist();
});
});
8 changes: 6 additions & 2 deletions example/e2e/testCases/optimizeTest.spec.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
/* global device, element, by */
import { by, device, element, expect } from 'detox';

describe('optimize', () => {
beforeAll(async () => {
await device.launchApp({ newInstance: true });
});

it('should load images after optimize', async () => {
await expect(element(by.id('example-exampleOptimize'))).toExist();

await waitFor(element(by.id('optimizeResult'))).toExist().withTimeout(2000);
await expect(element(by.id('optimizeResult'))).toExist();
});
});
10 changes: 7 additions & 3 deletions example/e2e/testCases/overlayImageTest.spec.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
/* global device, element, by */
import { by, device, element, expect } from 'detox';

describe('overlayImage', () => {
beforeAll(async () => {
await device.launchApp({ newInstance: true });
});

it('should load images after overlay image', async () => {
await expect(element(by.id('example-exampleOverlayImage'))).toExist();

await waitFor(element(by.id('overlayImageResult'))).toExist().withTimeout(2000);
await waitFor(element(by.id('overlayImagePngResult'))).toExist().withTimeout(2000);
await expect(element(by.id('overlayImageResult'))).toExist();
await expect(element(by.id('overlayImagePngResult'))).toExist();
});
});
10 changes: 7 additions & 3 deletions example/e2e/testCases/printTextTest.spec.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
/* global device, element, by */
import { by, device, element, expect } from 'detox';

describe('printText', () => {
beforeAll(async () => {
await device.launchApp({ newInstance: true });
});

it('should load images after printText', async () => {
await expect(element(by.id('example-examplePrintText'))).toExist();

await waitFor(element(by.id('printTextResult'))).toExist().withTimeout(2000);
await waitFor(element(by.id('printTextPngResult'))).toExist().withTimeout(2000);
await expect(element(by.id('printTextResult'))).toExist();
await expect(element(by.id('printTextPngResult'))).toExist();
});
});
6 changes: 5 additions & 1 deletion example/e2e/testCases/sanityTest.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
/* global device, element, by */
import { by, device, element, expect } from 'detox';

describe('PhotoManipulator', () => {
beforeAll(async () => {
await device.launchApp({ newInstance: true });
});

it('should load example app with no errors and show all the examples by default', async () => {
await expect(element(by.id('examplesTitle'))).toExist();
await expect(element(by.id('example-originalImage'))).toExist();
Expand Down
20 changes: 10 additions & 10 deletions example/ios/PhotoManipulatorExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = PhotoManipulatorExample/Images.xcassets; sourceTree = "<group>"; };
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = PhotoManipulatorExample/Info.plist; sourceTree = "<group>"; };
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = PhotoManipulatorExample/main.m; sourceTree = "<group>"; };
14E71C5D3FBB4DBEB463C029 /* Girassol-Regular.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = "Girassol-Regular.ttf"; path = "../assets/fonts/Girassol-Regular.ttf"; sourceTree = "<group>"; };
19F6CBCC0A4E27FBF8BF4A61 /* libPods-PhotoManipulatorExample-PhotoManipulatorExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-PhotoManipulatorExample-PhotoManipulatorExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
3B4392A12AC88292D35C810B /* Pods-PhotoManipulatorExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PhotoManipulatorExample.debug.xcconfig"; path = "Target Support Files/Pods-PhotoManipulatorExample/Pods-PhotoManipulatorExample.debug.xcconfig"; sourceTree = "<group>"; };
5709B34CF0A7D63546082F79 /* Pods-PhotoManipulatorExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PhotoManipulatorExample.release.xcconfig"; path = "Target Support Files/Pods-PhotoManipulatorExample/Pods-PhotoManipulatorExample.release.xcconfig"; sourceTree = "<group>"; };
Expand All @@ -45,7 +46,6 @@
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = PhotoManipulatorExample/LaunchScreen.storyboard; sourceTree = "<group>"; };
89C6BE57DB24E9ADA2F236DE /* Pods-PhotoManipulatorExample-PhotoManipulatorExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PhotoManipulatorExample-PhotoManipulatorExampleTests.release.xcconfig"; path = "Target Support Files/Pods-PhotoManipulatorExample-PhotoManipulatorExampleTests/Pods-PhotoManipulatorExample-PhotoManipulatorExampleTests.release.xcconfig"; sourceTree = "<group>"; };
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
14E71C5D3FBB4DBEB463C029 /* Girassol-Regular.ttf */ = {isa = PBXFileReference; name = "Girassol-Regular.ttf"; path = "../assets/fonts/Girassol-Regular.ttf"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -108,6 +108,15 @@
name = Frameworks;
sourceTree = "<group>";
};
7008CECC701B4C89BCBF6080 /* Resources */ = {
isa = PBXGroup;
children = (
14E71C5D3FBB4DBEB463C029 /* Girassol-Regular.ttf */,
);
name = Resources;
path = "";
sourceTree = "<group>";
};
832341AE1AAA6A7D00B99B32 /* Libraries */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -151,15 +160,6 @@
path = Pods;
sourceTree = "<group>";
};
7008CECC701B4C89BCBF6080 /* Resources */ = {
isa = "PBXGroup";
children = (
14E71C5D3FBB4DBEB463C029 /* Girassol-Regular.ttf */,
);
name = Resources;
sourceTree = "<group>";
path = "";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down

0 comments on commit e0eb0f4

Please sign in to comment.