Monday, October 23, 2023
HomeiOS DevelopmentHow can I dockerize my Cucumber-Appium Take a look at Suite for...

How can I dockerize my Cucumber-Appium Take a look at Suite for each Android and iOS bodily units


I’ve a reasonably sturdy testing suite to run Appium check automation for a cell app. It’s self contained; begins the appium server, determines driver capabilities, and runs my cucumber eventualities on each units in parallel utilizing TestNG. It really works actually nice all by itself.

My drawback is that now we hope to dockerize it and I am unable to determine or discover a docker picture that may let me run it.

Particularly iOS is the issue. I discovered a public picture (https://hub.docker.com/r/appium/appium/) nevertheless it solely works for Android and the one iOS one I might discover is a part of a paid service. I threw collectively a Dockerfile however I’m fairly certain it won’t work and I do know it will not work for iOS.

So my query is: What do I have to do to get a Docker Picture that has each iOS and Android Appium capabilities? Or does no exist already?

The Dockerfile, although I do not assume it’s helpful

# Use a base picture with Java 11 and mandatory instruments for Android and iOS
FROM openjdk:11-jdk

# Set the model of Android Command Line Instruments
ARG ANDROID_COMMAND_LINE_TOOLS_VERSION=newest

# Obtain and set up Android Command Line Instruments
RUN mkdir -p /decide/android-sdk && 
    cd /decide/android-sdk && 
    wget -q https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_COMMAND_LINE_TOOLS_VERSION}_latest.zip -O android-sdk.zip && 
    unzip -q android-sdk.zip && 
    rm android-sdk.zip

# Set surroundings variables
ENV ANDROID_HOME /decide/android-sdk
ENV PATH ${PATH}:${ANDROID_HOME}/instruments/bin:${ANDROID_HOME}/platform-tools

# Settle for the Android SDK licenses
RUN sure | sdkmanager --licenses

# Set up Android SDK parts
# Add mandatory parts primarily based in your necessities
RUN sdkmanager "platform-tools" "platforms;android-28" "build-tools;28.0.3" "extras;google;m2repository" "extras;android;m2repository"

# Set up iOS dependencies
RUN npm set up 
    xcode-select 
    authorize-ios 
    ios-deploy

# Set up Xcode
#
RUN mkdir -p /decide/xcode && 
    cd /decide/xcode && 
    wget -q <XCODE_DOWNLOAD_URL> -O xcode-install.dmg && 
    hdiutil mount xcode-install.dmg && 
    sudo installer -pkg /Volumes/Xcode/Xcode*.pkg -target / && 
    hdiutil unmount /Volumes/Xcode && 
    rm xcode-install.dmg

# Set up dependencies (extra iOS-related dependencies)
RUN npm set up 
    -g appcenter-cli 
    git


# Set up Maven
RUN apt-get replace && 
    apt-get set up -y wget && 
    wget "https://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz" && 
    tar -xf "apache-maven-$MAVEN_VERSION-bin.tar.gz" -C /usr/share && 
    mv "/usr/share/apache-maven-$MAVEN_VERSION" "$MAVEN_HOME" && 
    rm "apache-maven-$MAVEN_VERSION-bin.tar.gz" && 
    ln -s "$MAVEN_HOME/bin/mvn" "/usr/bin/mvn"

# Set Enviormental Variables
ENV APPCENTER_ACCESS_TOKEN = 1f24b8e9a7cfb41ad6e44f8404fa2b4cf5beab27

# Set Up repos
RUN appcenter distribute teams obtain -g <group> -a <app>

# Expose the Appium port
EXPOSE 4723

# Set the working listing
WORKDIR /check

# Copy your Appium check suite recordsdata into the picture
COPY . /check

# Command to start out your Appium exams
CMD ["sh", "build.sh"]



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments