├── docs ├── guide │ ├── reference │ │ └── .empty │ ├── how-to-guides │ │ └── index.md │ ├── concepts │ │ ├── what-is-end-to-end-testing.md │ │ ├── introduction-to-selenium-and-webdriver.md │ │ └── parallel-testing-in-nightwatch.md │ ├── configuration │ │ ├── enabling-http-keep-alive.md │ │ ├── using-test-globals-in-your-config.md │ │ ├── taking-screenshots-on-fail.md │ │ └── using-env-variables-in-your-config.md │ ├── running-tests │ │ ├── specifying-test-sources.md │ │ ├── choosing-a-test-runner.md │ │ ├── test-groups.md │ │ ├── test-tags.md │ │ ├── test-environments.md │ │ ├── nightwatch-runner.md │ │ ├── using-with-test-groups.md │ │ └── filtering-by-test-tags.md │ ├── writing-tests │ │ ├── writing-component-tests.md │ │ ├── understanding-element-visibility.md │ │ ├── using-commands-to-perform-actions.md │ │ ├── using-exports.md │ │ └── using-es6-async.md │ ├── webdriver-bidi │ │ └── overview.md │ ├── using-nightwatch │ │ ├── working-with-shadow-root-elements.md │ │ ├── uploading-files.md │ │ ├── visual-regression-testing.md │ │ ├── performance-testing.md │ │ ├── using-chrome-devtools-protocol.md │ │ └── using-xpath-selectors.md │ ├── using-third-party-runners │ │ ├── using-ava.md │ │ ├── using-jest.md │ │ └── using-external-mocha.md │ ├── index.md │ ├── migrating-to-nightwatch │ │ ├── folder_changes.png │ │ └── from-nightwatch-v1.md │ ├── comparison-with-leading-frameworks.md │ ├── resources │ │ ├── list-of-integrations.md │ │ └── migrating-to-nightwatch-2.md │ ├── browser-drivers │ │ ├── gecko-driver-firefox.md │ │ ├── safaridriver.md │ │ └── edgedriver.md │ ├── overview │ │ ├── whats-new.md │ │ └── what-is-webdriver.md │ ├── component-testing │ │ └── testing-vue-components.md │ ├── debugging-tests │ │ └── overview.md │ ├── extending-nightwatch │ │ └── adding-custom-reporters.md │ └── working-with-page-objects │ │ └── using-page-objects.md ├── api │ ├── alerts │ │ └── index.md │ ├── appium │ │ └── index.md │ ├── window │ │ └── index.md │ ├── cookies │ │ └── index.md │ ├── document │ │ └── index.md │ ├── expect │ │ ├── _url.md │ │ ├── _title.md │ │ ├── _element.md │ │ ├── element │ │ │ └── index.md │ │ ├── elements │ │ │ └── index.md │ │ ├── _elements.md │ │ └── _cookie.md │ └── method │ │ ├── executeAsync.md │ │ ├── end.md │ │ └── clearValue.md ├── index.md └── about │ ├── index.md │ ├── community │ └── index.md │ ├── contribute │ └── index.md │ └── highlights │ ├── index.md │ └── types-of-testing.md ├── .eslintignore ├── public ├── favicon.ico ├── img │ ├── banner.png │ ├── github.png │ ├── operation.png │ ├── banner-small.png │ ├── cloud-banner.png │ ├── logo_large.png │ ├── nightcloud.png │ ├── operation2.png │ ├── sample_test.png │ ├── screenshot.png │ ├── blog │ │ ├── tote.001.png │ │ ├── tote.002.png │ │ ├── tote.003.png │ │ ├── test_engineering.png │ │ ├── nightwatch-v2-alpha.png │ │ ├── nightwatch-v2-beta.png │ │ ├── nightwatch2-webinar.png │ │ ├── webinar-browserstack.jpg │ │ ├── nightwatch-browserstack.png │ │ ├── selenium-grid-nightwatch.png │ │ └── first-look-nightwatch-v2-preview.png │ ├── demotestoutput.png │ ├── folder_changes.png │ ├── browserstack-logo.png │ ├── logo-nightwatch.png │ ├── operation-cloud.png │ ├── sample_test_atom.png │ ├── banners │ │ ├── nightwatch.jpg │ │ ├── a11y-testing.png │ │ ├── react-component-testing.png │ │ ├── component-testing-overview.png │ │ └── storybook-component-testing.png │ ├── logos │ │ ├── Firefox_Logo_2017.png │ │ ├── WebKit_logo_(2015)_2.png │ │ ├── safari_icon_large_2x.png │ │ ├── Microsoft_Edge_logo.svg.png │ │ └── 1200px-Google_Chrome_icon.svg.png │ └── icons │ │ ├── management-128.svg │ │ ├── introspection-128.svg │ │ ├── debugging-128.svg │ │ ├── remote-128.svg │ │ ├── noconfig-128.svg │ │ └── plugins-128.svg ├── images │ ├── github.png │ ├── techradar.jpg │ ├── twitter.png │ ├── demo-output.png │ ├── quickstart.png │ ├── images1 │ │ ├── user1.webp │ │ ├── user2.webp │ │ ├── user3.webp │ │ ├── user4.webp │ │ ├── user5.webp │ │ ├── user6.webp │ │ ├── user7.webp │ │ ├── user8.webp │ │ ├── 2018070.jpeg │ │ ├── sample-photo.jpeg │ │ ├── navbar-toggler.svg │ │ ├── prev-arrow.svg │ │ ├── next-arrow.svg │ │ ├── facebook.svg │ │ ├── substack.svg │ │ ├── copy-mobile.svg │ │ ├── check-circle.svg │ │ ├── youtube.svg │ │ ├── email.svg │ │ ├── html.svg │ │ ├── twitter.svg │ │ ├── circleci.svg │ │ ├── json.svg │ │ ├── capabilities1.svg │ │ ├── bamboo.svg │ │ ├── nav-github.svg │ │ ├── discord.svg │ │ ├── slack.svg │ │ └── browserstack.svg │ ├── nightwatch-circle.png │ ├── landing │ │ ├── testimonial │ │ │ ├── timyao.png │ │ │ ├── davidmello.png │ │ │ ├── paulhammant.png │ │ │ ├── timyao_oaifir_c_scale,w_80.png │ │ │ ├── timyao_oaifir_c_scale,w_90.png │ │ │ ├── timyao_oaifir_c_scale_w_80.png │ │ │ ├── timyao_oaifir_c_scale_w_90.png │ │ │ ├── timyao_oaifir_c_scale,w_80.webp │ │ │ ├── timyao_oaifir_c_scale,w_90.webp │ │ │ ├── timyao_oaifir_c_scale_w_80.webp │ │ │ ├── timyao_oaifir_c_scale_w_90.webp │ │ │ ├── davidmello_iofo3t_c_scale,w_80.png │ │ │ ├── davidmello_iofo3t_c_scale,w_80.webp │ │ │ ├── davidmello_iofo3t_c_scale,w_90.png │ │ │ ├── davidmello_iofo3t_c_scale,w_90.webp │ │ │ ├── davidmello_iofo3t_c_scale_w_80.png │ │ │ ├── davidmello_iofo3t_c_scale_w_80.webp │ │ │ ├── davidmello_iofo3t_c_scale_w_90.png │ │ │ ├── davidmello_iofo3t_c_scale_w_90.webp │ │ │ ├── paulhammant_uowqen_c_scale,w_80.png │ │ │ ├── paulhammant_uowqen_c_scale,w_90.png │ │ │ ├── paulhammant_uowqen_c_scale_w_80.png │ │ │ ├── paulhammant_uowqen_c_scale_w_90.png │ │ │ ├── paulhammant_uowqen_c_scale,w_80.webp │ │ │ ├── paulhammant_uowqen_c_scale,w_90.webp │ │ │ ├── paulhammant_uowqen_c_scale_w_80.webp │ │ │ └── paulhammant_uowqen_c_scale_w_90.webp │ │ ├── compromise │ │ │ ├── compromise.png │ │ │ ├── compromise_stzord_c_scale,w_1110.png │ │ │ ├── compromise_stzord_c_scale,w_500.png │ │ │ ├── compromise_stzord_c_scale,w_500.webp │ │ │ ├── compromise_stzord_c_scale_w_1110.png │ │ │ ├── compromise_stzord_c_scale_w_500.png │ │ │ ├── compromise_stzord_c_scale_w_500.webp │ │ │ ├── compromise_stzord_c_scale,w_1110.webp │ │ │ └── compromise_stzord_c_scale_w_1110.webp │ │ ├── capabilities │ │ │ ├── cap1 │ │ │ │ ├── cap1.png │ │ │ │ ├── cap1_qzycfd_c_scale,w_300.png │ │ │ │ ├── cap1_qzycfd_c_scale_w_300.png │ │ │ │ ├── cap1_qzycfd_c_scale,w_1100.png │ │ │ │ ├── cap1_qzycfd_c_scale,w_1100.webp │ │ │ │ ├── cap1_qzycfd_c_scale,w_300.webp │ │ │ │ ├── cap1_qzycfd_c_scale_w_1100.png │ │ │ │ ├── cap1_qzycfd_c_scale_w_1100.webp │ │ │ │ └── cap1_qzycfd_c_scale_w_300.webp │ │ │ ├── cap2 │ │ │ │ ├── cap2.png │ │ │ │ ├── cap2_njfkxf_c_scale,w_300.png │ │ │ │ ├── cap2_njfkxf_c_scale_w_300.png │ │ │ │ ├── cap2_njfkxf_c_scale,w_1100.png │ │ │ │ ├── cap2_njfkxf_c_scale,w_1100.webp │ │ │ │ ├── cap2_njfkxf_c_scale,w_300.webp │ │ │ │ ├── cap2_njfkxf_c_scale_w_1100.png │ │ │ │ ├── cap2_njfkxf_c_scale_w_1100.webp │ │ │ │ └── cap2_njfkxf_c_scale_w_300.webp │ │ │ └── cap3 │ │ │ │ ├── cap3.png │ │ │ │ ├── cap3_uzdpil_c_scale,w_300.png │ │ │ │ ├── cap3_uzdpil_c_scale,w_849.png │ │ │ │ ├── cap3_uzdpil_c_scale_w_300.png │ │ │ │ ├── cap3_uzdpil_c_scale_w_849.png │ │ │ │ ├── cap3_uzdpil_c_scale,w_1100.png │ │ │ │ ├── cap3_uzdpil_c_scale,w_1100.webp │ │ │ │ ├── cap3_uzdpil_c_scale,w_300.webp │ │ │ │ ├── cap3_uzdpil_c_scale,w_849.webp │ │ │ │ ├── cap3_uzdpil_c_scale_w_1100.png │ │ │ │ ├── cap3_uzdpil_c_scale_w_1100.webp │ │ │ │ ├── cap3_uzdpil_c_scale_w_300.webp │ │ │ │ └── cap3_uzdpil_c_scale_w_849.webp │ │ ├── performance │ │ │ ├── performance.png │ │ │ ├── performance_vve109_c_scale,w_1600.png │ │ │ ├── performance_vve109_c_scale,w_1600.webp │ │ │ ├── performance_vve109_c_scale,w_400.png │ │ │ ├── performance_vve109_c_scale,w_400.webp │ │ │ ├── performance_vve109_c_scale_w_1600.png │ │ │ ├── performance_vve109_c_scale_w_1600.webp │ │ │ ├── performance_vve109_c_scale_w_400.png │ │ │ └── performance_vve109_c_scale_w_400.webp │ │ ├── features │ │ │ ├── feature3 │ │ │ │ ├── feature3.png │ │ │ │ ├── feature3_tcbm76_c_scale,w_1070.png │ │ │ │ ├── feature3_tcbm76_c_scale,w_1100.png │ │ │ │ ├── feature3_tcbm76_c_scale,w_300.png │ │ │ │ ├── feature3_tcbm76_c_scale,w_300.webp │ │ │ │ ├── feature3_tcbm76_c_scale,w_580.png │ │ │ │ ├── feature3_tcbm76_c_scale,w_580.webp │ │ │ │ ├── feature3_tcbm76_c_scale,w_758.png │ │ │ │ ├── feature3_tcbm76_c_scale,w_758.webp │ │ │ │ ├── feature3_tcbm76_c_scale_w_1070.png │ │ │ │ ├── feature3_tcbm76_c_scale_w_1100.png │ │ │ │ ├── feature3_tcbm76_c_scale_w_300.png │ │ │ │ ├── feature3_tcbm76_c_scale_w_300.webp │ │ │ │ ├── feature3_tcbm76_c_scale_w_580.png │ │ │ │ ├── feature3_tcbm76_c_scale_w_580.webp │ │ │ │ ├── feature3_tcbm76_c_scale_w_758.png │ │ │ │ ├── feature3_tcbm76_c_scale_w_758.webp │ │ │ │ ├── feature3_tcbm76_c_scale,w_1070.webp │ │ │ │ ├── feature3_tcbm76_c_scale,w_1100.webp │ │ │ │ ├── feature3_tcbm76_c_scale_w_1070.webp │ │ │ │ └── feature3_tcbm76_c_scale_w_1100.webp │ │ │ ├── feature1 │ │ │ │ ├── feature-1.png │ │ │ │ ├── feature-1_h3xpny_c_scale,w_420.png │ │ │ │ ├── feature-1_h3xpny_c_scale,w_871.png │ │ │ │ ├── feature-1_h3xpny_c_scale_w_420.png │ │ │ │ ├── feature-1_h3xpny_c_scale_w_871.png │ │ │ │ ├── feature-1_h3xpny_c_scale,w_1385.png │ │ │ │ ├── feature-1_h3xpny_c_scale,w_1385.webp │ │ │ │ ├── feature-1_h3xpny_c_scale,w_1389.png │ │ │ │ ├── feature-1_h3xpny_c_scale,w_1389.webp │ │ │ │ ├── feature-1_h3xpny_c_scale,w_1748.png │ │ │ │ ├── feature-1_h3xpny_c_scale,w_1748.webp │ │ │ │ ├── feature-1_h3xpny_c_scale,w_1806.png │ │ │ │ ├── feature-1_h3xpny_c_scale,w_1806.webp │ │ │ │ ├── feature-1_h3xpny_c_scale,w_2000.png │ │ │ │ ├── feature-1_h3xpny_c_scale,w_2000.webp │ │ │ │ ├── feature-1_h3xpny_c_scale,w_420.webp │ │ │ │ ├── feature-1_h3xpny_c_scale,w_871.webp │ │ │ │ ├── feature-1_h3xpny_c_scale_w_1385.png │ │ │ │ ├── feature-1_h3xpny_c_scale_w_1385.webp │ │ │ │ ├── feature-1_h3xpny_c_scale_w_1389.png │ │ │ │ ├── feature-1_h3xpny_c_scale_w_1389.webp │ │ │ │ ├── feature-1_h3xpny_c_scale_w_1748.png │ │ │ │ ├── feature-1_h3xpny_c_scale_w_1748.webp │ │ │ │ ├── feature-1_h3xpny_c_scale_w_1806.png │ │ │ │ ├── feature-1_h3xpny_c_scale_w_1806.webp │ │ │ │ ├── feature-1_h3xpny_c_scale_w_2000.png │ │ │ │ ├── feature-1_h3xpny_c_scale_w_2000.webp │ │ │ │ ├── feature-1_h3xpny_c_scale_w_420.webp │ │ │ │ └── feature-1_h3xpny_c_scale_w_871.webp │ │ │ └── feature2 │ │ │ │ ├── feature-2.png │ │ │ │ ├── feature-2_wr5j5v_c_scale,w_420.png │ │ │ │ ├── feature-2_wr5j5v_c_scale,w_888.png │ │ │ │ ├── feature-2_wr5j5v_c_scale_w_420.png │ │ │ │ ├── feature-2_wr5j5v_c_scale_w_888.png │ │ │ │ ├── feature-2_wr5j5v_c_scale,w_1216.png │ │ │ │ ├── feature-2_wr5j5v_c_scale,w_1216.webp │ │ │ │ ├── feature-2_wr5j5v_c_scale,w_1405.png │ │ │ │ ├── feature-2_wr5j5v_c_scale,w_1405.webp │ │ │ │ ├── feature-2_wr5j5v_c_scale,w_1661.png │ │ │ │ ├── feature-2_wr5j5v_c_scale,w_1661.webp │ │ │ │ ├── feature-2_wr5j5v_c_scale,w_1836.png │ │ │ │ ├── feature-2_wr5j5v_c_scale,w_1836.webp │ │ │ │ ├── feature-2_wr5j5v_c_scale,w_2000.png │ │ │ │ ├── feature-2_wr5j5v_c_scale,w_2000.webp │ │ │ │ ├── feature-2_wr5j5v_c_scale,w_420.webp │ │ │ │ ├── feature-2_wr5j5v_c_scale,w_888.webp │ │ │ │ ├── feature-2_wr5j5v_c_scale_w_1216.png │ │ │ │ ├── feature-2_wr5j5v_c_scale_w_1216.webp │ │ │ │ ├── feature-2_wr5j5v_c_scale_w_1405.png │ │ │ │ ├── feature-2_wr5j5v_c_scale_w_1405.webp │ │ │ │ ├── feature-2_wr5j5v_c_scale_w_1661.png │ │ │ │ ├── feature-2_wr5j5v_c_scale_w_1661.webp │ │ │ │ ├── feature-2_wr5j5v_c_scale_w_1836.png │ │ │ │ ├── feature-2_wr5j5v_c_scale_w_1836.webp │ │ │ │ ├── feature-2_wr5j5v_c_scale_w_2000.png │ │ │ │ ├── feature-2_wr5j5v_c_scale_w_2000.webp │ │ │ │ ├── feature-2_wr5j5v_c_scale_w_420.webp │ │ │ │ └── feature-2_wr5j5v_c_scale_w_888.webp │ │ └── integrations │ │ │ ├── html.svg │ │ │ ├── sauce.svg │ │ │ ├── json.svg │ │ │ └── slack.svg │ ├── features-h-line.svg │ ├── features-v-line.svg │ ├── features-top.svg │ ├── button-download.svg │ ├── clouds.svg │ ├── moon.svg │ ├── button-github.svg │ ├── features-illustration4.svg │ └── features-illustration7.svg ├── css │ ├── landing │ │ └── fonts │ │ │ ├── source-sans-3.woff2 │ │ │ ├── ibm-plex-mono-400.woff2 │ │ │ ├── ibm-plex-mono-600.woff2 │ │ │ ├── ibm-plex-mono-700.woff2 │ │ │ └── source-sans-3-italic.woff2 │ ├── reset.css │ └── comparison-with-leading-frameworks.css ├── robots.txt └── ~partytown │ ├── partytown.js │ └── debug │ └── partytown-sw.js ├── src ├── includes │ ├── header │ │ └── scripts.ejs │ ├── gtm_body.ejs │ ├── prism.ejs │ ├── docsearch.ejs │ ├── gtm.ejs │ ├── scripts.ejs │ ├── sections │ │ ├── releases.ejs │ │ └── api.ejs │ ├── ga.ejs │ ├── rightSidebarContent.ejs │ ├── meta-tags.ejs │ └── header.ejs ├── js │ └── app-node.js └── pages │ ├── about │ └── index.ejs │ └── api │ └── index.ejs ├── .gitignore ├── LICENSE.md ├── package.json └── .github └── workflows ├── deploy.yml └── deploy-preview.yml /docs/guide/reference/.empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/guide/how-to-guides/index.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/api/alerts/index.md: -------------------------------------------------------------------------------- 1 | [//]: # (/alerts/index.html) -------------------------------------------------------------------------------- /docs/api/appium/index.md: -------------------------------------------------------------------------------- 1 | [//]: # (/appium/index.html) -------------------------------------------------------------------------------- /docs/api/window/index.md: -------------------------------------------------------------------------------- 1 | [//]: # (/window/index.html) -------------------------------------------------------------------------------- /docs/guide/concepts/what-is-end-to-end-testing.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/guide/configuration/enabling-http-keep-alive.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/guide/running-tests/specifying-test-sources.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/guide/writing-tests/writing-component-tests.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/api/cookies/index.md: -------------------------------------------------------------------------------- 1 | [//]: # (/cookies/index.html) -------------------------------------------------------------------------------- /docs/api/document/index.md: -------------------------------------------------------------------------------- 1 | [//]: # (/document/index.html) -------------------------------------------------------------------------------- /docs/guide/webdriver-bidi/overview.md: -------------------------------------------------------------------------------- 1 | ## Webdriver BiDi -------------------------------------------------------------------------------- /docs/guide/concepts/introduction-to-selenium-and-webdriver.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/guide/writing-tests/understanding-element-visibility.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/guide/writing-tests/using-commands-to-perform-actions.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | [//]: # (index.html -- Main page for the website) -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package.json 3 | *.json 4 | out 5 | -------------------------------------------------------------------------------- /docs/guide/using-nightwatch/working-with-shadow-root-elements.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/guide/using-nightwatch/uploading-files.md: -------------------------------------------------------------------------------- 1 | ## Uploading Files with Nightwatch -------------------------------------------------------------------------------- /docs/guide/using-nightwatch/visual-regression-testing.md: -------------------------------------------------------------------------------- 1 | ## Visual Regression Testing -------------------------------------------------------------------------------- /docs/guide/using-third-party-runners/using-ava.md: -------------------------------------------------------------------------------- 1 | ## Running Nightwatch tests with Ava -------------------------------------------------------------------------------- /docs/guide/using-third-party-runners/using-jest.md: -------------------------------------------------------------------------------- 1 | ## Running Nightwatch tests with Jest -------------------------------------------------------------------------------- /docs/guide/using-nightwatch/performance-testing.md: -------------------------------------------------------------------------------- 1 | https://github.com/sitespeedio/browsertime -------------------------------------------------------------------------------- /docs/guide/using-third-party-runners/using-external-mocha.md: -------------------------------------------------------------------------------- 1 | ## Using Nightwatch with Mocha (External) -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nightwatchjs/nightwatch-docs/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /public/img/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nightwatchjs/nightwatch-docs/HEAD/public/img/banner.png -------------------------------------------------------------------------------- /public/img/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nightwatchjs/nightwatch-docs/HEAD/public/img/github.png -------------------------------------------------------------------------------- /docs/guide/using-nightwatch/using-chrome-devtools-protocol.md: -------------------------------------------------------------------------------- 1 | ## Using the Chrome Devtools Protocol in Nightwatch -------------------------------------------------------------------------------- /public/images/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nightwatchjs/nightwatch-docs/HEAD/public/images/github.png -------------------------------------------------------------------------------- /public/img/operation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nightwatchjs/nightwatch-docs/HEAD/public/img/operation.png -------------------------------------------------------------------------------- /docs/guide/running-tests/choosing-a-test-runner.md: -------------------------------------------------------------------------------- 1 |
this.demoTest = function (browser) {
9 | browser.expect.url().to.contain('https://');
10 | browser.expect.url().to.endWith('.org');
11 | };
12 | this.demoTest = function (browser) {
10 | browser.expect.title().to.contain('value');
11 | browser.expect.title().to.match(/value/);
12 | };
13 | <%- release['body'].replace(/
5 | module.exports = {
6 | before : function(browser) {
7 | // see https://github.com/nightwatchjs/nightwatch/blob/main/examples/globalsModule.js#L12
8 | browser.globals.waitForConditionTimeout = 5000;
9 | },
10 |
11 | 'executeAsync example test' : function (browser) {
12 |
13 | browser
14 | .timeoutsAsyncScript(10000)
15 | .executeAsync(function (inputVal, done) {
16 | // ... do stuff with window ...
17 | setTimeout(done, 5000, 'result');
18 | },
19 | ['input'],
20 | function (resultVal) {
21 | console.log('result =', resultVal);
22 | }
23 | );
24 | },
25 |
26 | after : function(browser) {
27 | browser.end();
28 | }
29 | };
30 | browser.element('#selector')
8 | | Name | 16 |Type | 17 |description | 18 |
|---|---|---|
selector |
23 | String | 24 |The CSS/XPath selector of the element to be inspected. | 25 |
14 | {
15 | "test_settings" : {
16 | "default" : {
17 | "screenshots" : {
18 | "enabled" : true,
19 | "on_failure" : true,
20 | "path" : "./screens"
21 | }
22 | }
23 | }
24 | }
25 |
26 | 7 | lib/ 8 | ├── selenium-server-standalone.jar 9 | custom-commands/ 10 | ├── loginUser.js 11 | ├── attachPicture.js 12 | tests/ 13 | ├── logingroup 14 | | ├── login_test.js 15 | | └── otherlogin_test.js 16 | ├── addressbook 17 | | ├── addressbook_test.js 18 | | └── contact_test.js 19 | ├── chat 20 | | ├── chatwindow_test.js 21 | | ├── chatmessage_test.js 22 | | └── otherchat_test.js 23 | └── smoketests 24 | ├── smoke_test.js 25 | └── othersmoke_test.js 26 |27 | 28 | To run only the `smoketests` group you would do the following: 29 | 30 |
nightwatch --group smoketests
31 |
32 | Also, if you would want to skip running the `smoketests` group you would do the following:
33 |
34 | nightwatch --skipgroup smoketests
35 |
36 | To skip multiple groups, just add them as comma-separated:
37 |
38 | nightwatch --skipgroup addressbook,chat
39 |
40 | - Previous: [Using Test Environments](/guide/running-tests/test-environments.html)
41 | - Next: [Using Test Tags](/guide/running-tests/test-tags.html)
42 |
--------------------------------------------------------------------------------
/public/~partytown/partytown.js:
--------------------------------------------------------------------------------
1 | /* Partytown 0.8.2 - MIT builder.io */
2 | !function(t,e,n,i,o,r,a,s,d,c,l,p){function u(){p||(p=1,"/"==(a=(r.lib||"/~partytown/")+(r.debug?"debug/":""))[0]&&(d=e.querySelectorAll('script[type="text/partytown"]'),i!=t?i.dispatchEvent(new CustomEvent("pt1",{detail:t})):(s=setTimeout(f,1e4),e.addEventListener("pt0",w),o?h(1):n.serviceWorker?n.serviceWorker.register(a+(r.swPath||"partytown-sw.js"),{scope:a}).then((function(t){t.active?h():t.installing&&t.installing.addEventListener("statechange",(function(t){"activated"==t.target.state&&h()}))}),console.error):f())))}function h(t){c=e.createElement(t?"script":"iframe"),t||(c.style.display="block",c.style.width="0",c.style.height="0",c.style.border="0",c.style.visibility="hidden",c.setAttribute("aria-hidden",!0)),c.src=a+"partytown-"+(t?"atomics.js?v=0.8.2":"sandbox-sw.html?"+Date.now()),e.querySelector(r.sandboxParent||"body").appendChild(c)}function f(n,o){for(w(),i==t&&(r.forward||[]).map((function(e){delete t[e.split(".")[0]]})),n=0;nbrowser.elements('#selector')
9 | | Name | 17 |Type | 18 |description | 19 |
|---|---|---|
selector |
24 | String | 25 |The CSS/XPath selector of the collection of elements to be inspected. | 26 |
Checks if the number of elements specified by a selector is equal or not to a given value.
34 | 35 |this.demoTest = function (browser) {
38 | browser.expect.elements('div').count.to.equal(10);
39 | browser.expect.elements('p').count.to.not.equal(1);
40 | }
41 | browser.expect.cookie('cookie-name', ['cookie-domain'])
9 | this.demoTest = function (browser) {
13 | browser.expect.cookie('cookie-name').to.contain('cookie-value');
14 | browser.expect.cookie('cookie-name').to.match(/regex/);
15 | browser.expect.cookie('loginCookie', 'example.org').to.contain('cookie-value');
16 | };
17 | | Name | 25 |Type | 26 |description | 27 |
|---|---|---|
name |
32 | String | 33 |The name of the cookie to be inspected. | 34 |
domainOptional |
37 | String | 38 |The domain name on which the cookie is set to. | 39 |
{
17 | "src_folders": [],
18 |
19 | "test_settings": {
20 | "default": {
21 | "launch_url": "https://nightwatchjs.org",
22 |
23 | "globals": {
24 | "myGlobalVar" : "some value",
25 | "otherGlobal" : "some other value"
26 | }
27 | }
28 | }
29 | }
30 |
31 | module.exports = {
38 | 'Demo test' : function (browser) {
39 | console.log(browser.globals.myGlobalVar); // myGlobalVar == "some value"
40 | }
41 | };
42 |
43 | module.exports = {
9 | '@tags': ['login', 'sanity'],
10 | 'demo login test': function (browser) {
11 | // test code
12 | }
13 | };
14 | describe('testsuite', function() {
20 | this.tags = ['login', 'sanity'];
21 |
22 | it('demo login test', function(browser) {
23 |
24 | });
25 | });
26 | nightwatch --tag login
31 |
32 | nightwatch --tag login --tag something_else
36 |
37 | nightwatch --skiptags login
41 | nightwatch --skiptags login,something_else
45 |
46 | - Previous: [Using Test Groups](/guide/running-tests/test-groups.html)
47 | - Next: [Running in Parallel](/guide/running-tests/parallel-running.html)
48 |
--------------------------------------------------------------------------------
/public/images/images1/capabilities1.svg:
--------------------------------------------------------------------------------
1 |
14 |
--------------------------------------------------------------------------------
/docs/guide/configuration/taking-screenshots-on-fail.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Taking screenshots on failures/errors
3 | description: Learn how to enable taking screenshots on failures/errors in Nightwatch.
4 | ---
5 |
6 |
14 | {
15 | "test_settings" : {
16 | "default" : {
17 | "screenshots" : {
18 | "enabled" : true,
19 | "on_failure" : true,
20 | "path" : "./screens"
21 | }
22 | }
23 | }
24 | }
25 |
26 | A "default" environment is required. All the other environments are inheriting from default and can overwrite settings as needed.
7 | 8 | An environment inherits all the base settings and all the settings defined under the "default" environment. 9 | 10 |{
11 | ...
12 | "test_settings" : {
13 | "default" : {
14 | "launch_url" : "http://localhost",
15 | "globals" : {
16 | "myGlobalVar" : "some value",
17 | "otherGlobal" : "some other value"
18 | }
19 | },
20 |
21 | "integration" : {
22 | "launch_url" : "http://staging.host",
23 | "globals" : {
24 | "myGlobalVar" : "other value"
25 | }
26 | }
27 | }
28 | }
29 | nightwatch --env integration
34 |
35 | This can be useful if you need to have different settings for your local machine and the Continuous Integration server.
36 |
37 | ### Further Reading:
38 | - [Understanding Test Environments](/gettingstarted/concepts/#defining-test-environments)
39 | - Previous: [Command-line Options](/guide/running-tests/command-line-options.html)
40 | - Next: [Using Test Groups](/guide/running-tests/test-groups.html)
41 |
--------------------------------------------------------------------------------
/public/images/images1/discord.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/public/img/icons/remote-128.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/guide/debugging-tests/overview.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Debugging tests
3 | description: Learn how to debugs tests using Nightwatch tools
4 | ---
5 |
6 | nightwatch [source] [options]
9 |
10 | #### Project specific
11 | If you have Nightwatch installed as a dependency of your project, you can refer the binary from the `node_modules/.bin` folder or use the [`npx`](https://www.npmjs.com/package/npx) command which is provided by NPM.
12 |
13 | npx nightwatch [source] [options]
14 |
15 | ##### Linux and MacOSX:
16 | ./node_modules/.bin/nightwatch [source] [options]
17 |
18 | ##### Windows:
19 | Create a file `nightwatch.js` and add the following line:
20 |
21 | require('nightwatch/bin/runner.js');
22 |
23 | Then run as follows:
24 |
25 | node nightwatch.js [source] [options]
26 |
27 | ### Tests source
28 | The optional `source` argument can be either one or more files or an entire folder. This can be located irrespectively of the `src_folders` setting.
29 |
30 | ##### Example - single test:
31 |
32 | nightwatch tests/one/firstTest.js
33 |
34 | ##### Example - 2 individual tests:
35 | nightwatch tests/one/firstTest.js tests/secondTest.js
36 |
37 | ##### Example - 1 individual test and 1 folder:
38 | nightwatch tests/one/test.js tests/utils
39 |
40 | - Next: [Command-line Options](/guide/running-tests/command-line-options.html)
41 |
--------------------------------------------------------------------------------
/src/pages/api/index.ejs:
--------------------------------------------------------------------------------
1 | <%
2 | const path = require('path');
3 |
4 | let commandName = path.basename(page.url, path.extname(page.url));
5 | let commandDescr = '';
6 |
7 | if (commandName === 'index') {
8 | commandName = '';
9 | }
10 |
11 | if (commandName) {
12 | const namespace = page.url.split('/').slice(2);
13 | namespace.pop();
14 | const commandNamespace = namespace.join('.');
15 |
16 | if (namespace.length) {
17 | commandName = `${commandNamespace}.${commandName}`;
18 | }
19 |
20 | commandDescr = `Complete API reference for the ${commandName} Nightwatch command/assertion.`;
21 | commandName = `${commandName} | API Reference | Nightwatch.js`;
22 | }
23 |
24 | let pageContent = page.content;
25 |
26 | if (page.comments) {
27 | // Each API file contains exactly 1 doc comment, so we can safely get it.
28 | const method = page.comments[0];
29 |
30 | const fileLink = /\/lib.+$/.exec(page.commentsSourcePath)[0];
31 | const editLink = `${appSettings.apiRepoUrl}/${appSettings.githubRepo}/edit/main${fileLink}?message=api-docs%20update`;
32 |
33 | pageContent = await include('api-method', {
34 | method,
35 | editLink,
36 | });
37 | }
38 |
39 | const data = {
40 | version: appSettings.version,
41 | baseUrl: appSettings.baseUrl,
42 | section: 'api',
43 | pageContent: pageContent,
44 | pageTitle: commandName ? commandName : (page.title || 'API Reference | Nightwatch.js'),
45 | pageDescription: commandDescr ? commandDescr : (page.description || 'Complete reference of the Nightwatch commands and assertions.'),
46 | pageImage: page.image || '/img/banners/nightwatch.jpg'
47 | };
48 | %>
49 |
50 |
51 |
52 |
53 | <%- include("fonts", data) %>
54 | <%- include("header", data) %>
55 |
56 |
57 |
58 |
59 | <%- include("navbar", data) %>
60 |
61 |
7 | module.exports = {
8 | before : function(browser) {
9 | // see https://github.com/nightwatchjs/nightwatch/blob/main/examples/globalsModule.js#L12
10 | browser.globals.waitForConditionTimeout = 5000;
11 | },
12 |
13 | 'clearValue example test' : function (browser) {
14 |
15 | browser
16 | .url('https://google.com')
17 | .waitForElementVisible('input[type=text]')
18 | .setValue('input[type=text]', 'nightwatch.js')
19 | .click('button[type=submit]')
20 | .expect.element('#rcnt').text.to.contain('nightwatchjs.org/');
21 |
22 | browser
23 | .clearValue('input[type=text]')
24 | .expect.element('#rcnt').text.to.equal('');
25 | },
26 |
27 | after : function(browser) {
28 | browser.end();
29 | }
30 | };
31 |
32 | 37 | [Clear Value] Test Suite 38 | ============================ 39 | 40 | Running: clearValue example test 41 | ✔ Element <input[type=text]> was visible after 68 milliseconds. 42 | ✔ Expected element <#rcnt> text to contain: "nightwatchjs.org/" - condition was met in 763ms 43 | ✔ Expected element <#rcnt> text to equal: "" - condition was met in 36ms 44 | 45 | OK. 3 assertions passed. (7.593s) 46 |47 |
module.exports = {
18 | write : function(results, options, done) {
19 | done();
20 | }
21 | };module.exports = {
32 | reporter : function(results, done) {
33 | console.log(results);
34 | done();
35 | }
36 | };
37 | 1.0 Nightwatch does not support legacy page objects written prior to version 0.7.
10 | module.exports = {
28 | url: 'https://google.com',
29 | elements: {}
30 | };
31 |
32 | module.exports = {
38 | url: function() {
39 | return this.api.launchUrl + '/login';
40 | },
41 | elements: {}
42 | };
43 |
44 | module.exports = {
14 | 'Demo test ecosia.org' : function(browser) {
15 | browser
16 | .url('https://www.ecosia.org/')
17 | .waitForElementVisible('body')
18 | .assert.titleContains('Ecosia')
19 | .assert.visible('input[type=search]')
20 | .setValue('input[type=search]', 'nightwatch')
21 | .assert.visible('button[type=submit]')
22 | .click('button[type=submit]')
23 | .assert.containsText('.mainline-results', 'Nightwatch.js')
24 | .end();
25 | }
26 | };
27 | module.exports = {
34 | 'step one: navigate to ecosia.org': function(browser) {
35 | browser
36 | .url('https://www.ecosia.org')
37 | .waitForElementVisible('body')
38 | .assert.titleContains('Ecosia')
39 | .assert.visible('input[type=search]')
40 | .setValue('input[type=search]', 'nightwatch')
41 | .assert.visible('button[type=submit]');
42 | },
43 |
44 | 'step two: click submit' : function (browser) {
45 | browser
46 | .click('button[type=submit]')
47 | .assert.containsText('.mainline-results', 'Nightwatch.js')
48 | .end();
49 | }
50 | };13 | lib/ 14 | ├── selenium-server-standalone.jar 15 | custom-commands/ 16 | ├── loginUser.js 17 | ├── attachPicture.js 18 | tests/ 19 | ├── logingroup 20 | | ├── login_test.js 21 | | └── otherlogin_test.js 22 | ├── addressbook 23 | | ├── addressbook_test.js 24 | | └── contact_test.js 25 | ├── chat 26 | | ├── chatwindow_test.js 27 | | ├── chatmessage_test.js 28 | | └── otherchat_test.js 29 | └── smoketests 30 | ├── smoke_test.js 31 | └── othersmoke_test.js 32 |33 | 34 | To run only the `smoketests` group you would do the following: 35 | 36 |
nightwatch --group smoketests
37 |
38 | Also, if you would want to skip running the `smoketests` group you would do the following:
39 |
40 | nightwatch --skipgroup smoketests
41 |
42 | To skip multiple groups, just add them as comma-separated:
43 |
44 | nightwatch --skipgroup addressbook,chat
45 |
46 | desiredCapabilities) and then run them in parallel. In addition, using the filter and exclude options tests can be split per environment in order to be ran in parallel.
23 |
24 | ### Via workers + multiple environments
25 |
26 | It is very useful to be able to run your tests against multiple browsers in parallel and also distribute your testcases across multiple workers.
27 | From **v1.7** you are able to do just that.
28 |
29 | ### Recommended content
30 | - [Define and use test environments](/guide/configuration/define-test-environments.html)
31 | - [How-to guide > Run tests in parallel](/guide/running-tests/parallel-running.html)
32 |
33 | module.exports = {
10 | 'demo test async': async function (browser) {
11 | // get the available window handles
12 | const result = await browser.windowHandles();
13 | console.log('result', result);
14 |
15 | // switch to the second window
16 | // await is not necessary here since we're not interested in the result
17 | browser.switchWindow(result.value[1]);
18 | }
19 | };module.exports = {
27 | 'demo test async': async function (browser) {
28 | // get the available window handles
29 | const value = await browser.windowHandles(function(result) {
30 | // we only want the value, not the entire result object
31 | return Promise.resolve(result.value);
32 | });
33 |
34 | console.log('value', value);
35 |
36 | // switch to the second window
37 | browser.switchWindow(value[1]);
38 | }
39 | };
24 | "desiredCapabilities" : {
25 | "browserName" : "safari",
26 | "javascriptEnabled" : true,
27 | "acceptSslCerts" : true
28 | }
29 |
30 |
31 | ### Safari specific capabilities
32 |
33 | Learn more about [Safari-specific capabilities](https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities#safari-specific).
34 |
35 |
36 | [1]: http://selenium-release.storage.googleapis.com/index.html
37 | [2]: https://github.com/SeleniumHQ/selenium/issues/2725
38 |
39 |
16 | "localEdge": {
17 | selenium_host: "127.0.0.1",
18 | selenium_port: 4444,
19 | selenium: {
20 | start_process: true,
21 | host: "127.0.0.1",
22 | port: 4444,
23 | cli_args: {
24 | "webdriver.edge.driver": "C:\\Program Files (x86)\\Microsoft Web Driver\\MicrosoftWebDriver.exe",
25 | }
26 | },
27 | desiredCapabilities: {
28 | platform: "Windows 10",
29 | browserName: "MicrosoftEdge",
30 | javascriptEnabled: true
31 | }
32 | }
33 |
34 |
35 | ### Learn more
36 |
37 | For more information about the Microsoft Edge WebDriver refer to the [Official documentation](https://developer.microsoft.com/en-us/microsoft-edge/platform/documentation/dev-guide/tools/webDriver/).
38 |
39 | module.exports = {
16 | src_folders: [],
17 |
18 | test_settings: {
19 | default: {
20 | launch_url: 'https://nightwatchjs.org'
21 | },
22 |
23 | browserstack: {
24 | webdriver: {
25 | start_process: false
26 | },
27 |
28 | selenium: {
29 | host: 'hub-cloud.browserstack.com',
30 | port: 443
31 | },
32 |
33 | desiredCapabilities: {
34 | browserName: 'chrome',
35 | 'bstack:options' : {
36 | userName: '${BROWSERSTACK_USERNAME}',
37 | accessKey: '${BROWSERSTACK_ACCESS_KEY}',
38 | }
39 | }
40 | }
41 | }
42 | }module.exports = {
15 | '@tags': ['login', 'sanity'],
16 | 'demo login test': function (browser) {
17 | // test code
18 | }
19 | };
20 | describe('testsuite', function() {
26 | this.tags = ['login', 'sanity'];
27 |
28 | it('demo login test', function(browser) {
29 |
30 | });
31 | });
32 | nightwatch --tag login
38 |
39 | nightwatch --tag login --tag something_else
43 |
44 | nightwatch --skiptags login
50 | nightwatch --skiptags login,something_else
54 |
55 |
12 | module.exports = {
13 | demoTest: function (browser) {
14 | browser
15 | .useXpath() // every selector now must be xpath
16 | .click("//tr[@data-recordid]/span[text()='Search Text']")
17 | .useCss() // we're back to CSS now
18 | .setValue('input[type=text]', 'nightwatch')
19 | }
20 | };
27 | module.exports = {
28 | demoTest(browser) {
29 | // using element selector objects
30 | browser.click({
31 | selector: '//tr[@data-recordid]/span[text()='Search Text']',
32 | locateStrategy: 'xpath'
33 | });
34 |
35 | // specifying xpath strategy as first argument
36 | browser.click('xpath', '//tr[@data-recordid]/span[text()='Search Text']');
37 | }
38 | };