Skip to content

Devansh013/LT-appium-nodejs-webdriverio

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LT-appium-nodejs-webdriverio

Sample repo to run app automation on real device on LambdaTest.

Pre-requisites

  • Download and install NodeJS. You should be having NodeJS v6 or newer. Click here to download.
  • Make sure you are using the latest version of JavaScript.
  • Install npm from the official website by clicking here.

Clone The Sample Project

Step-1: Clone the LambdaTest’s LT-appium-nodejs-webdriverio and navigate to the code directory as shown below:

git clone https://github.com/LambdaTest/LT-appium-nodejs-webdriverio
cd LT-appium-nodejs-webdriverio

Setting Up Your Authentication

Make sure you have your LambdaTest credentials with you to run test automation scripts on LambdaTest. To obtain your access credentials, purchase a plan or access the Automation Dashboard.

Step-2: Set LambdaTest Username and Access Key in environment variables.

export LT_USERNAME="YOUR_LAMBDATEST_USERNAME"
export LT_ACCESS_KEY="YOUR_LAMBDATEST_ACCESS_KEY"

Upload Your Application

Step-3: Upload your iOS application (.ipa file) or android application (.apk file) to the LambdaTest servers using our REST API. You need to provide your Username and AccessKey in the format Username:AccessKey in the cURL command for authentication. Make sure to add the path of the appFile in the cURL request. Here is an example cURL request to upload your app using our REST API:

For Linux / MacOS:

curl -u "YOUR_LAMBDATEST_USERNAME":"YOUR_LAMBDATEST_ACCESS_KEY" \
--location --request POST 'https://manual-api.lambdatest.com/app/upload/realDevice' \
--form 'name="Android_App"' \
--form 'appFile=@"/Users/macuser/Downloads/proverbial_android.apk"' 

For Windows:

curl -u "YOUR_LAMBDATEST_USERNAME":"YOUR_LAMBDATEST_ACCESS_KEY" -X POST "https://manual-api.lambdatest.com/app/upload/realDevice" -F "appFile=@"/Users/macuser/Downloads/proverbial_android.apk""

Note:

  • If you do not have any .apk or .ipa file, you can run your sample tests on LambdaTest by using our sample 🔗 Android app or sample 🔗 iOS app.
  • Response of above cURL will be a JSON object containing the App URL of the format - lt://APP123456789123456789 and will be used in the next step.

Executing The Tests

If you are using an iOS app, the cURL command will generate an app URL for the corresponding iOS app and install the same for running the tests. You can either use our sample 🔗 iOS app or upload your own app as discussed earlier.

Step-4: Navigate to the corresponding directory based on your app.

  • For android:
    cd android-sample
  • For ios:
    cd ios-sample

Step-5: Install the required dependencies using the following command:

npm i

Step-6: Execute the following command to run your test on LambdaTest platform:

npm run single

Your test results would be displayed on the test console (or command-line interface if you are using terminal/cmd) and on the 🔗 LambdaTest App Automation Dashboard.

About

LT-appium-nodejs-webdriverio repo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%