-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* java native ios * java native FPS * clean pom * fix dockerfile * gh action * gh action * gh action * gh action * fix readme * newlines * fix sauce build name * add FPS to readme
- Loading branch information
Showing
16 changed files
with
955 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Java iOS Tests | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'java-ios-app/**' | ||
- '.github/workflows/java-ios.yml' | ||
branches: | ||
- main | ||
pull_request: | ||
paths: | ||
- 'java-ios-app/**' | ||
- '.github/workflows/java-ios.yml' | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
java-ios-app: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install saucectl | ||
uses: saucelabs/saucectl-run-action@v4 | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
skip-run: true | ||
|
||
- name: Pre-Upload App | ||
id: upload | ||
working-directory: ./wdio-ios-app/ | ||
env: | ||
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }} | ||
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} | ||
run: | | ||
APP_FILEID=$(saucectl storage upload ./app/SauceLabs-Demo-App.ipa -o json | jq -r '.id') | ||
SIMULATOR_APP_FILEID=$(saucectl storage upload ./app/SauceLabs-Demo-App.Simulator.ipa -o json | jq -r '.id') | ||
echo "APP_FILEID=${APP_FILEID}" >> $GITHUB_OUTPUT | ||
echo "SIMULATOR_APP_FILEID=${SIMULATOR_APP_FILEID}" >> $GITHUB_OUTPUT | ||
- name: Build example | ||
uses: docker/[email protected] | ||
env: | ||
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }} | ||
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} | ||
with: | ||
context: ./java-ios-app | ||
file: ./java-ios-app/Dockerfile | ||
build-args: | | ||
APP_FILEID=${{ steps.upload.outputs.APP_FILEID }} | ||
SIMULATOR_APP_FILEID=${{ steps.upload.outputs.SIMULATOR_APP_FILEID }} | ||
push: false | ||
secret-envs: | | ||
"SAUCE_USERNAME=SAUCE_USERNAME" | ||
"SAUCE_ACCESS_KEY=SAUCE_ACCESS_KEY" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
target/ | ||
.idea/ | ||
.DS_Store | ||
*.iml |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip | ||
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
FROM eclipse-temurin:8u432-b06-jdk-jammy AS runner | ||
|
||
# Install curl | ||
RUN apt-get update && apt-get install -y curl | ||
# Install runme | ||
RUN curl -sSL https://download.stateful.com/runme/3.9.2/runme_linux_x86_64.tar.gz | tar -xz -C /usr/local/bin runme | ||
|
||
FROM runner | ||
RUN mkdir -p /workspace | ||
WORKDIR /workspace | ||
COPY . . | ||
|
||
ARG APP_FILEID | ||
|
||
RUN --mount=type=secret,id=SAUCE_USERNAME,env=SAUCE_USERNAME \ | ||
--mount=type=secret,id=SAUCE_ACCESS_KEY,env=SAUCE_ACCESS_KEY \ | ||
runme run mvn-run-ios-test | ||
|
||
RUN --mount=type=secret,id=SAUCE_USERNAME,env=SAUCE_USERNAME \ | ||
--mount=type=secret,id=SAUCE_ACCESS_KEY,env=SAUCE_ACCESS_KEY \ | ||
runme run mvn-run-ios-test-modified |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Getting started with Sauce Labs Visual Java + iOS Native App [![](https://badgen.net/badge/Run%20this%20/README/5B3ADF?icon=https://runme.dev/img/logo.svg)](https://runme.dev/api/runme?repository=git%40github.com%3Asaucelabs%2Fvisual-examples.git) | ||
|
||
## Prerequisites | ||
|
||
- For macOS Ventura: Git and Homebrew | ||
- For Linux: Git and Eclipse Temurin JDK 8+ (https://adoptium.net/temurin/releases/) | ||
- Sauce Labs Account | ||
|
||
## Run the demo | ||
|
||
- Install Eclipse Temurin JDK (for macOS Ventura): | ||
|
||
```sh { "name":"java" } | ||
brew install --cask temurin | ||
``` | ||
|
||
- Clone the repository: | ||
|
||
```sh { "name":"clone" } | ||
git clone https://github.com/saucelabs/visual-examples | ||
cd visual-examples/java-ios-app | ||
``` | ||
|
||
- Configure with your Sauce credentials from https://app.saucelabs.com/user-settings | ||
|
||
```sh { "name":"set-credentials" } | ||
export SAUCE_USERNAME=__YOUR_SAUCE_USERNAME__ | ||
export SAUCE_ACCESS_KEY=__YOUR_SAUCE_ACCESS_KEY__ | ||
``` | ||
|
||
- Run the test | ||
|
||
```sh { "name":"mvn-run-ios-test" } | ||
./mvnw clean test | ||
``` | ||
|
||
- Review your screenshots by clicking on the url printed in the test or go to https://app.saucelabs.com/visual/builds. | ||
- Accept all diffs, so they become new baselines. | ||
- Re-run the tests | ||
|
||
```sh { "name":"mvn-run-ios-test-modified" } | ||
VISUAL_CHECK=enabled ./mvnw clean test | ||
``` | ||
|
||
- Open the test or go to https://app.saucelabs.com/visual/builds to review changes. | ||
|
||
|
||
**NOTE**: If you'd like run the full page screenshot test additionally, | ||
you need to pass the environment variable FPS=enabled when running the test. | ||
|
||
```sh { "name":"mvn-run-ios-test-fps" } | ||
FPS=enabled ./mvnw clean test | ||
``` | ||
|
||
## Installation & Usage | ||
|
||
View installation and usage instructions on | ||
the [Sauce Docs website](https://docs.saucelabs.com/visual-testing/integrations/java/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../wdio-ios-app/app/SauceLabs-Demo-App.Simulator.ipa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../wdio-ios-app/app/SauceLabs-Demo-App.ipa |
Oops, something went wrong.