The demo scripts in this repository allow you to run simple automated tests in order to validate your JavaScript test environment and your saucelabs.com account credentials.
The code in these scripts is provided on an "AS-IS" basis without warranty of any kind, either express or implied, including without limitation any implied warranties of condition, uninterrupted use, merchantability, fitness for a particular purpose, or non-infringement. These scripts are provided for educational and demonstration purposes only, and should not be used in production. Issues regarding these scripts should be submitted through GitHub. These scripts are maintained by the Technical Services team at Sauce Labs.
Some examples in this repository, such as
appium-examples
andheadless-examples
, may require a different account tier beyond free trial. Please contact the Sauce Labs Sales Team for support and information.
- Tests that can help you quickly and easily get started with Sauce Labs
- W3C examples using Sauce Labs
- Tests that use the Headless feature of Sauce Labs (not included with basic tier or free trial customers)
- Mobile Examples using Appium on Sauce Labs
In order to run these scripts you must complete the following prerequisite steps:
- Install Git
- Install NPM/Node
- Install a Framework
- (Optional) Install an IDE
Select the button below to try this demo in Gitpod
After the gitpod session launches, navigate to the terminal and run the following commands to save your Sauce Labs Credentials to gitpod as environment variables:
eval $(gp env -e SAUCE_USERNAME=******) eval $(gp env -e SAUCE_ACCESS_KEY=******)
Click the following link if you're unsure how to access your Sauce Labs credentials. Also, if you start a new terminal in gitpod, you have to run the following command to reset envrionment variables:
eval $(gp env -e)
For more information consult the gitpod documentation
-
Clone the Repository and set your Sauce Labs Credentials:
git clone https://github.com/saucelabs-training/demo-js.git export SAUCE_USERNAME=******** export SAUCE_ACCESS_KEY=*******
-
Navigate to the desired directory (e.g.):
cd mocha-chai-tests
-
Resolve Dependencies (via
package.json
)npm install
-
Run the Test
npm test
You should see the following output in the console:
> [email protected] test /path/to/demo-js > node on-boarding-modules/node-examples/module2-test.js Test Passed!
-
Visit the saucelabs.com automated build page and select the build
Onboarding Sample App - NodeJS
to see the following test case: