Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow local context to be passed to browser.debug command. #4299

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

garg3133
Copy link
Member

With this enhancement in the browser.debug() command, users will now be able to pass the local variables from their test into the Debug mode and use them there.

Example

On running the below example, someLocalFunction and someLocalVariable will be directly available inside the DEBUG mode (along with browser) and can be used like a local variable.

function someLocalFunction() {
  console.log('local function running');

  return 'local function result';
}

describe('duckduckgo example', function() {
  it('Search Nightwatch.js and check results', async function(browser) {
    const someLocalVariable = 'something random';

    browser
      .navigateTo('http://duckduckgo.com')
      .click('input[name=q]');

    browser.debug({context: {someLocalVariable, someLocalFunction}});
  });
});
image

Copy link

Status

  • ❌ No modified files found in the types directory.
    Please make sure to include types for any changes you have made. Thank you!.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant