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.config.ts
file with basic settings will be generated at the root of the project.
export default {
// https://testplane.io/docs/v8/guides/local-browsers/
gridUrl: "local",
baseUrl: "http://localhost",
pageLoadTimeout: 0,
httpTimeout: 60000,
testTimeout: 90000,
resetCursor: false,
sets: {
desktop: {
files: ["testplane-tests/**/*.testplane.(t|j)s"],
browsers: ["chrome", "firefox"],
},
},
browsers: {
chrome: {
headless: true,
desiredCapabilities: {
browserName: "chrome",
},
},
firefox: {
headless: true,
desiredCapabilities: {
browserName: "firefox",
},
},
},
plugins: {
"html-reporter/testplane": {
// https://github.com/gemini-testing/html-reporter
enabled: true,
path: "testplane-report",
defaultView: "all",
diffMode: "3-up-scaled",
},
},
};
You can download these browsers, described in the config, separately from running Testplane itself:
npx testplane install-deps
Without running the command, absent browsers will be downloaded during first Testplane launch.
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