-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Description
Description of the bug/issue
When I use limited pauses mixed with page object commands I expect there to be no type errors when the commands are valid, but instead, after upgrading to v3.11.1 I receive error PageObjectCommandNameHere does not exist on type 'Awaitable<NightwatchAPI, undefined>'
e.g.
myPage.pause(200).myPageObjectCommand(); // Property 'myPageObjectCommand' does not exist on type 'Awaitable<NightwatchAPI, undefined>'.
Steps to reproduce
- Create a typescript project setup with page objects
- In the page object create a page object command
- In the test, chain that command after a pause(n) statement
You should see the error. This was not occurring in v3.10.2
Sample test
import { NightwatchAPI, NightwatchTests } from 'nightwatch';
import { DuckPage } from '../page-objects/duckPage';
const home: NightwatchTests = {
'Duck Duck go navigate': () => {
const duckPage: DuckPage = browser.page.DuckPage();
duckPage.navigate();
duckPage.pause(200).clickRightOfToggleButton('dsf', 'sdf');
},
};
export default home;
Command to run
N/A
Verbose Output
N/A
Nightwatch Configuration
// Refer to the online docs for more details:
// https://nightwatchjs.org/gettingstarted/configuration/
//
// _ _ _ _ _ _ _
// | \ | |(_) | | | | | | | |
// | \| | _ __ _ | |__ | |_ __ __ __ _ | |_ ___ | |__
// | . ` || | / _` || '_ \ | __|\ \ /\ / / / _` || __| / __|| '_ \
// | |\ || || (_| || | | || |_ \ V V / | (_| || |_ | (__ | | | |
// \_| \_/|_| \__, ||_| |_| \__| \_/\_/ \__,_| \__| \___||_| |_|
// __/ |
// |___/
module.exports = {
// An array of folders (excluding subfolders) where your tests are located;
// if this is not specified, the test source must be passed as the second argument to the test runner.
src_folders: ['nightwatch/tests'],
// See https://nightwatchjs.org/guide/concepts/page-object-model.html
page_objects_path: ['nightwatch/page-objects'],
// See https://nightwatchjs.org/guide/extending-nightwatch/adding-custom-commands.html
custom_commands_path: [],
// See https://nightwatchjs.org/guide/extending-nightwatch/adding-custom-assertions.html
custom_assertions_path: [],
// See https://nightwatchjs.org/guide/extending-nightwatch/adding-plugins.html
plugins: [],
// See https://nightwatchjs.org/guide/concepts/test-globals.html
globals_path: '',
webdriver: {},
test_workers: {
enabled: true,
},
test_settings: {
default: {
disable_error_log: false,
launch_url: 'http://localhost',
screenshots: {
enabled: false,
path: 'screens',
on_failure: true,
},
desiredCapabilities: {
browserName: 'chrome',
},
webdriver: {
start_process: true,
server_path: '',
},
},
chrome: {
desiredCapabilities: {
browserName: 'chrome',
'goog:chromeOptions': {
// More info on Chromedriver: https://sites.google.com/a/chromium.org/chromedriver/
args: [
//'--no-sandbox',
//'--ignore-certificate-errors',
//'--allow-insecure-localhost',
//'--headless=new'
],
},
},
webdriver: {
start_process: true,
server_path: '',
cli_args: [
// --verbose
],
},
},
},
};
Nightwatch.js Version
3.11.1
Node Version
22.13.1
Browser
Chrome
Operating System
Windows
Additional Information
Metadata
Metadata
Assignees
Labels
No labels