You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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';consthome: NightwatchTests={'Duck Duck go navigate': ()=>{constduckPage: DuckPage=browser.page.DuckPage();duckPage.navigate();duckPage.pause(200).clickRightOfToggleButton('dsf','sdf');},};exportdefaulthome;
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.htmlpage_objects_path: ['nightwatch/page-objects'],// See https://nightwatchjs.org/guide/extending-nightwatch/adding-custom-commands.htmlcustom_commands_path: [],// See https://nightwatchjs.org/guide/extending-nightwatch/adding-custom-assertions.htmlcustom_assertions_path: [],// See https://nightwatchjs.org/guide/extending-nightwatch/adding-plugins.htmlplugins: [],// See https://nightwatchjs.org/guide/concepts/test-globals.htmlglobals_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],},},},};
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.
Steps to reproduce
You should see the error. This was not occurring in v3.10.2
Sample test
Command to run
Verbose Output
Nightwatch Configuration
Nightwatch.js Version
3.11.1
Node Version
22.13.1
Browser
Chrome
Operating System
Windows
Additional Information
example project.zip
The text was updated successfully, but these errors were encountered: