Quick Start
Installation
Run the Testplane installer using npm
.
npm init testplane@latest YOUR_PROJECT_PATH
If you do not want to use the defaults when initializing the project and want to configure it using a wizard, specify the -v
option.
Setup
After executing the command mentioned above, a .testplane.conf.js
file with basic settings will be generated at the root of the project. Depending on which protocol you want to use, there are 2 configuration options (by default, the CDP protocol will be specified for the browser).
- Chrome Devtools Protocol
- WebDriver protocol
module.exports = {
sets: {
desktop: {
files: 'tests/desktop'
}
},
browsers: {
chrome: {
automationProtocol: 'devtools',
desiredCapabilities: {
browserName: 'chrome'
}
}
}
};
module.exports = {
gridUrl: 'http://localhost:4444/wd/hub',
sets: {
desktop: {
files: 'tests/desktop'
}
},
browsers: {
chrome: {
automationProtocol: 'webdriver', // default value
desiredCapabilities: {
browserName: 'chrome'
}
}
}
};
Creating a Test
Navigate to the tests/example.testplane.js
file with a test. Here you can see a test example or write your own. For example,
describe("github", async function () {
it("should find testplane", async function ({ browser }) {
await browser.url("https://github.com/gemini-testing/testplane");
const elem = await browser.$("#readme h1");
await expect(elem).toHaveText("Testplane");
});
});
Running a Test
Now you can run the tests:
npx testplane
or launch the GUI mode and run the test through the browser interface
npx testplane gui
If you chose the WebDriver protocol
during the config setup, you should have selenium-standalone
running (in a separate tab) before running the tests:
selenium-standalone start