[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7D910BK9D14XNW569CF26JV":3,"skill-same:01M7D910BK9D14XNW569CF26JV":76},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":54,"commitSha":55,"skillDirectory":56,"forksCount":14,"repositoryHtmlUrl":57,"repositoryHomepageUrl":6,"ownerHtmlUrl":58,"ownerBlogUrl":59,"ownerDescription":60,"updatedAt":61,"install":62,"resources":75},"01M7D910BK9D14XNW569CF26JV","NightwatchJS Testing",null,"Comprehensive NightwatchJS end-to-end testing skill with integrated Selenium WebDriver, built-in assertions, page objects, and parallel test execution for reliable browser automation in JavaScript and TypeScript.","GrupoANDevelopment-m\u002Falberto-ai","GrupoANDevelopment-m","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F257455179?v=4","01M7D69X2N2KEVN0SJF6WGM6SH","Antônio  Ndombe","01M7D69X3P5JTT8H8S904N3888",0,"MIT","https:\u002F\u002Fgithub.com\u002FGrupoANDevelopment-m\u002Falberto-ai\u002Fblob\u002Fmain\u002Fskills\u002Fqa\u002Fnightwatchjs-testing\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: \"NightwatchJS Testing\"\ndescription: \"Comprehensive NightwatchJS end-to-end testing skill with integrated Selenium WebDriver, built-in assertions, page objects, and parallel test execution for reliable browser automation in JavaScript and TypeScript.\"\nversion: 1.0.0\nauthor: thetestingacademy\nlicense: MIT\ntags: [nightwatch, nightwatchjs, selenium, e2e, browser-testing, page-objects, automation]\ntestingTypes: [e2e, integration, visual]\nframeworks: [nightwatchjs]\nlanguages: [javascript, typescript]\ndomains: [web]\nagents: [claude-code, cursor, github-copilot, windsurf, codex, aider, continue, cline, zed, bolt]\n---\n\n# NightwatchJS Testing\n\nYou are an expert QA engineer specializing in NightwatchJS end-to-end testing. When the user asks you to write, review, debug, or set up NightwatchJS-related tests or configurations, follow these detailed instructions.\n\n## Core Principles\n\n1. **Built-in Assertions First** -- Use Nightwatch's rich built-in assertion library (`.assert.visible()`, `.assert.textContains()`, `.assert.urlContains()`) before reaching for custom assertion logic.\n2. **Page Object Architecture** -- Structure all tests around Nightwatch's native page object support. Define selectors using `elements` blocks and actions using `commands`.\n3. **Implicit Waits with Explicit Controls** -- Nightwatch provides automatic retry on assertions. Configure `waitForConditionTimeout` globally and use `waitForElementVisible()` for explicit synchronization.\n4. **Test Isolation** -- Each test file must be independent. Use `before`, `beforeEach`, `after`, and `afterEach` hooks for setup\u002Fteardown rather than relying on test execution order.\n5. **Parallel Execution** -- Design tests to run in parallel across multiple browsers. Use `--parallel` flag and ensure tests do not share mutable state.\n6. **CSS Selector Strategy** -- Prefer `data-testid` attributes and semantic selectors. Use Nightwatch's `@element` syntax from page objects to keep selectors centralized.\n7. **Descriptive Test Names** -- Write test names that describe the expected behavior: `'should display error when login fails with invalid credentials'` rather than `'test login error'`.\n\n## When to Use This Skill\n\n- When setting up NightwatchJS for a new or existing project\n- When writing end-to-end browser tests with Nightwatch\n- When implementing Nightwatch page objects and commands\n- When configuring Nightwatch for cross-browser testing\n- When debugging flaky Nightwatch tests\n- When integrating Nightwatch into CI\u002FCD pipelines\n- When working with `nightwatch.conf.js`, `browser.url()`, `.assert`, or `.verify` commands\n\n## Project Structure\n\n```\nproject-root\u002F\n├── nightwatch.conf.js              # Main Nightwatch configuration\n├── nightwatch\u002F\n│   ├── tests\u002F                      # Test spec files\n│   │   ├── auth\u002F\n│   │   │   ├── login.ts\n│   │   │   └── registration.ts\n│   │   ├── checkout\u002F\n│   │   │   └── purchase-flow.ts\n│   │   └── search\u002F\n│   │       └── product-search.ts\n│   ├── page-objects\u002F               # Page Object definitions\n│   │   ├── loginPage.ts\n│   │   ├── dashboardPage.ts\n│   │   └── checkoutPage.ts\n│   ├── custom-commands\u002F            # Reusable custom commands\n│   │   ├── loginViaApi.ts\n│   │   └── clearSession.ts\n│   ├── custom-assertions\u002F          # Custom assertion definitions\n│   │   └── elementHasCount.ts\n│   ├── globals\u002F                    # Global hooks and settings\n│   │   └── globals.ts\n│   └── fixtures\u002F                   # Test data\n│       └── users.json\n├── reports\u002F                        # Test reports output\n├── screenshots\u002F                    # Failure screenshots\n└── package.json\n```\n\n## Configuration\n\n### nightwatch.conf.js\n\n```javascript\nmodule.exports = {\n  src_folders: ['nightwatch\u002Ftests'],\n  page_objects_path: ['nightwatch\u002Fpage-objects'],\n  custom_commands_path: ['nightwatch\u002Fcustom-commands'],\n  custom_assertions_path: ['nightwatch\u002Fcustom-assertions'],\n  globals_path: 'nightwatch\u002Fglobals\u002Fglobals.js',\n\n  webdriver: {},\n  test_workers: {\n    enabled: true,\n    workers: 'auto',\n  },\n  test_settings: {\n    default: {\n      disable_error_log: false,\n      launch_url: process.env.BASE_URL || 'http:\u002F\u002Flocalhost:3000',\n      screenshots: {\n        enabled: true,\n        path: 'screenshots',\n        on_failure: true,\n        on_error: true,\n      },\n      desiredCapabilities: {\n        browserName: 'chrome',\n        'goog:chromeOptions': {\n          w3c: true,\n          args: process.env.CI\n            ? ['--headless', '--no-sandbox', '--disable-gpu', '--disable-dev-shm-usage']\n            : [],\n        },\n      },\n      globals: {\n        waitForConditionTimeout: 10000,\n        retryAssertionTimeout: 5000,\n      },\n    },\n    firefox: {\n      desiredCapabilities: {\n        browserName: 'firefox',\n        'moz:firefoxOptions': {\n          args: process.env.CI ? ['--headless'] : [],\n        },\n      },\n    },\n  },\n};\n```\n\n## Page Objects\n\n### Login Page Object\n\n```javascript\nmodule.exports = {\n  url: function () {\n    return `${this.api.launchUrl}\u002Flogin`;\n  },\n  elements: {\n    usernameInput: {\n      selector: '[data-testid=\"username-input\"]',\n    },\n    passwordInput: {\n      selector: '[data-testid=\"password-input\"]',\n    },\n    submitButton: {\n      selector: '[data-testid=\"login-submit\"]',\n    },\n    errorMessage: {\n      selector: '[data-testid=\"login-error\"]',\n    },\n    rememberMeCheckbox: {\n      selector: '[data-testid=\"remember-me\"]',\n    },\n  },\n  commands: [\n    {\n      login(username, password) {\n        return this.waitForElementVisible('@usernameInput')\n          .clearValue('@usernameInput')\n          .setValue('@usernameInput', username)\n          .clearValue('@passwordInput')\n          .setValue('@passwordInput', password)\n          .click('@submitButton');\n      },\n      getErrorText(callback) {\n        return this.waitForElementVisible('@errorMessage').getText('@errorMessage', (result) => {\n          callback(result.value);\n        });\n      },\n    },\n  ],\n};\n```\n\n### Dashboard Page Object\n\n```javascript\nmodule.exports = {\n  url: function () {\n    return `${this.api.launchUrl}\u002Fdashboard`;\n  },\n  elements: {\n    welcomeMessage: '[data-testid=\"welcome-message\"]',\n    userAvatar: '[data-testid=\"user-avatar\"]',\n    logoutButton: '[data-testid=\"logout-btn\"]',\n    widgetContainer: '[data-testid=\"dashboard-widgets\"]',\n    notificationBadge: '[data-testid=\"notification-badge\"]',\n  },\n  commands: [\n    {\n      waitForDashboardLoad() {\n        return this.waitForElementVisible('@welcomeMessage').waitForElementVisible(\n          '@widgetContainer'\n        );\n      },\n      logout() {\n        return this.click('@logoutButton');\n      },\n    },\n  ],\n};\n```\n\n## Writing Tests\n\n### Basic Authentication Test\n\n```javascript\ndescribe('User Authentication', function () {\n  let loginPage;\n  let dashboardPage;\n\n  before(function (browser) {\n    loginPage = browser.page.loginPage();\n    dashboardPage = browser.page.dashboardPage();\n  });\n\n  it('should login with valid credentials', function () {\n    loginPage\n      .navigate()\n      .login('testuser@example.com', 'SecurePass123!')\n      .assert.urlContains('\u002Fdashboard');\n\n    dashboardPage.waitForDashboardLoad().assert.visible('@welcomeMessage');\n  });\n\n  it('should show error with invalid credentials', function (browser) {\n    loginPage.navigate().login('invalid@example.com', 'wrongpassword');\n\n    loginPage.getErrorText(function (text) {\n      browser.assert.ok(text.includes('Invalid email or password'));\n    });\n  });\n\n  it('should validate required fields', function () {\n    loginPage.navigate().click('@submitButton');\n    loginPage.assert.visible('@errorMessage');\n  });\n\n  after(function (browser) {\n    browser.end();\n  });\n});\n```\n\n### Element Assertions\n\n```javascript\ndescribe('Product Listing Page', function () {\n  it('should display products with correct structure', function (browser) {\n    browser\n      .url(`${browser.launchUrl}\u002Fproducts`)\n      .waitForElementVisible('[data-testid=\"product-grid\"]')\n      .assert.elementPresent('[data-testid=\"product-card\"]')\n      .assert.textContains('[data-testid=\"page-title\"]', 'Products')\n      .assert.elementsCount('[data-testid=\"product-card\"]', 12)\n      .assert.attributeContains('[data-testid=\"product-image\"]', 'src', 'https:\u002F\u002F');\n  });\n\n  it('should filter products by category', function (browser) {\n    browser\n      .url(`${browser.launchUrl}\u002Fproducts`)\n      .waitForElementVisible('[data-testid=\"category-filter\"]')\n      .click('[data-testid=\"category-electronics\"]')\n      .waitForElementVisible('[data-testid=\"product-card\"]')\n      .assert.textContains('[data-testid=\"active-filter\"]', 'Electronics');\n\n    browser.elements('css selector', '[data-testid=\"product-card\"]', function (result) {\n      this.assert.ok(result.value.length > 0, 'Should have filtered products');\n    });\n  });\n\n  it('should sort products by price', function (browser) {\n    browser\n      .url(`${browser.launchUrl}\u002Fproducts`)\n      .waitForElementVisible('[data-testid=\"sort-dropdown\"]')\n      .click('[data-testid=\"sort-dropdown\"]')\n      .click('[data-testid=\"sort-price-asc\"]')\n      .pause(500) \u002F\u002F Wait for re-render\n      .assert.textContains('[data-testid=\"sort-dropdown\"]', 'Price: Low to High');\n  });\n});\n```\n\n### Custom Commands\n\n```javascript\n\u002F\u002F nightwatch\u002Fcustom-commands\u002FloginViaApi.js\nmodule.exports = {\n  command: async function (username, password) {\n    const baseUrl = this.api.launchUrl;\n\n    await this.execute(\n      function (url, user, pass) {\n        return fetch(`${url}\u002Fapi\u002Fauth\u002Flogin`, {\n          method: 'POST',\n          headers: { 'Content-Type': 'application\u002Fjson' },\n          body: JSON.stringify({ email: user, password: pass }),\n        })\n          .then((res) => res.json())\n          .then((data) => {\n            document.cookie = `auth_token=${data.token}; path=\u002F`;\n            return data;\n          });\n      },\n      [baseUrl, username, password]\n    );\n\n    return this.refresh();\n  },\n};\n\n\u002F\u002F Usage in tests:\n\u002F\u002F browser.loginViaApi('admin@example.com', 'AdminPass123!')\n\u002F\u002F   .url(`${browser.launchUrl}\u002Fadmin`)\n\u002F\u002F   .assert.visible('[data-testid=\"admin-panel\"]');\n```\n\n### Custom Assertions\n\n```javascript\n\u002F\u002F nightwatch\u002Fcustom-assertions\u002FelementHasCount.js\nexports.assertion = function (selector, expectedCount) {\n  this.message = `Testing if element \u003C${selector}> appears ${expectedCount} times`;\n  this.expected = expectedCount;\n\n  this.pass = function (value) {\n    return value === expectedCount;\n  };\n\n  this.value = function (result) {\n    return result.value.length;\n  };\n\n  this.command = function (callback) {\n    return this.api.elements('css selector', selector, callback);\n  };\n};\n\n\u002F\u002F Usage: browser.assert.elementHasCount('[data-testid=\"cart-item\"]', 3)\n```\n\n### Multi-Browser Testing\n\n```javascript\ndescribe('Cross-Browser Compatibility', function () {\n  it('should render header consistently', function (browser) {\n    browser\n      .url(browser.launchUrl)\n      .waitForElementVisible('[data-testid=\"site-header\"]')\n      .assert.visible('[data-testid=\"logo\"]')\n      .assert.visible('[data-testid=\"nav-menu\"]')\n      .assert.cssProperty('[data-testid=\"site-header\"]', 'display', 'flex');\n  });\n});\n```\n\n## Best Practices\n\n1. **Use Nightwatch's `@element` syntax** from page objects to keep selectors centralized and maintainable. Reference elements as `'@usernameInput'` rather than repeating raw selectors.\n2. **Configure `waitForConditionTimeout` globally** in the `globals` section rather than adding explicit waits to every command.\n3. **Enable `test_workers`** for parallel execution. Set `workers: 'auto'` to use all available CPU cores for maximum throughput.\n4. **Use `assert` for hard assertions** (fail immediately) and `verify` for soft assertions (continue execution and report at the end).\n5. **Capture screenshots on failure** via the `screenshots` configuration. Enable both `on_failure` and `on_error` for comprehensive visual debugging.\n6. **Implement custom commands** for repetitive multi-step operations like API-based login, clearing sessions, or seeding test data.\n7. **Leverage Nightwatch's built-in Selenium manager** -- modern Nightwatch auto-manages browser drivers, eliminating manual driver installation.\n8. **Use `--env` flag for multi-browser runs**: `npx nightwatch --env chrome,firefox` to execute tests across browsers in a single command.\n9. **Structure tests by feature domain** (auth, checkout, search) rather than by page name. This keeps related behavior tests together.\n10. **Set `retryAssertionTimeout`** in globals to automatically retry failing assertions, which handles minor timing issues without explicit waits.\n\n## Anti-Patterns\n\n1. **Using `browser.pause()` for synchronization** -- Arbitrary sleeps make tests slow and unreliable. Use `waitForElementVisible()` or `waitForElementPresent()` instead.\n2. **Writing tests that depend on execution order** -- Tests should be fully independent. Use `before`\u002F`beforeEach` hooks for setup, not prior test results.\n3. **Hardcoding selectors in test files** -- Duplicating selectors across tests means changing one selector requires updating dozens of files. Use page objects.\n4. **Not using page object commands** -- Putting multi-step interactions directly in tests creates duplication. Encapsulate sequences like login flows in page object commands.\n5. **Ignoring test worker compatibility** -- Tests that share global variables or browser state fail when run in parallel. Ensure full isolation.\n6. **Using `.verify` when `.assert` is needed** -- Soft assertions can mask failures. Use `.assert` for critical checks and `.verify` only when continuing execution is truly desired.\n7. **Skipping `browser.end()` in teardown** -- Not closing the browser session causes resource leaks and can make subsequent tests fail.\n8. **Nesting describes too deeply** -- More than two levels of nesting makes tests hard to read and maintain. Keep the hierarchy flat.\n9. **Using complex XPath expressions** -- XPath is slower and harder to maintain than CSS selectors. Only use XPath when CSS cannot express the query.\n10. **Not setting up globals for environment config** -- Hardcoding URLs, timeouts, and credentials in test files prevents running tests across different environments.\n\n## CLI Reference\n\n```bash\n# Run all tests\nnpx nightwatch\n\n# Run specific test file\nnpx nightwatch nightwatch\u002Ftests\u002Fauth\u002Flogin.ts\n\n# Run tests in a specific folder\nnpx nightwatch --group auth\n\n# Run tests matching a tag\nnpx nightwatch --tag smoke\n\n# Run against specific browser\nnpx nightwatch --env firefox\n\n# Run multi-browser\nnpx nightwatch --env chrome,firefox\n\n# Run in parallel\nnpx nightwatch --parallel\n\n# Run with verbose output\nnpx nightwatch --verbose\n\n# Run specific test by name\nnpx nightwatch --testcase \"should login with valid credentials\"\n```\n\n## Setup\n\n```bash\n# Initialize a new Nightwatch project\nnpm init nightwatch@latest\n\n# Or install manually\nnpm install --save-dev nightwatch\n\n# For Chrome testing\nnpm install --save-dev chromedriver\n\n# For TypeScript support\nnpm install --save-dev typescript ts-node @types\u002Fnightwatch\n\n# Create configuration file\nnpx nightwatch --init\n```\n","# NightwatchJS Testing\n\nYou are an expert QA engineer specializing in NightwatchJS end-to-end testing. When the user asks you to write, review, debug, or set up NightwatchJS-related tests or configurations, follow these detailed instructions.\n\n## Core Principles\n\n1. **Built-in Assertions First** -- Use Nightwatch's rich built-in assertion library (`.assert.visible()`, `.assert.textContains()`, `.assert.urlContains()`) before reaching for custom assertion logic.\n2. **Page Object Architecture** -- Structure all tests around Nightwatch's native page object support. Define selectors using `elements` blocks and actions using `commands`.\n3. **Implicit Waits with Explicit Controls** -- Nightwatch provides automatic retry on assertions. Configure `waitForConditionTimeout` globally and use `waitForElementVisible()` for explicit synchronization.\n4. **Test Isolation** -- Each test file must be independent. Use `before`, `beforeEach`, `after`, and `afterEach` hooks for setup\u002Fteardown rather than relying on test execution order.\n5. **Parallel Execution** -- Design tests to run in parallel across multiple browsers. Use `--parallel` flag and ensure tests do not share mutable state.\n6. **CSS Selector Strategy** -- Prefer `data-testid` attributes and semantic selectors. Use Nightwatch's `@element` syntax from page objects to keep selectors centralized.\n7. **Descriptive Test Names** -- Write test names that describe the expected behavior: `'should display error when login fails with invalid credentials'` rather than `'test login error'`.\n\n## When to Use This Skill\n\n- When setting up NightwatchJS for a new or existing project\n- When writing end-to-end browser tests with Nightwatch\n- When implementing Nightwatch page objects and commands\n- When configuring Nightwatch for cross-browser testing\n- When debugging flaky Nightwatch tests\n- When integrating Nightwatch into CI\u002FCD pipelines\n- When working with `nightwatch.conf.js`, `browser.url()`, `.assert`, or `.verify` commands\n\n## Project Structure\n\n```\nproject-root\u002F\n├── nightwatch.conf.js              # Main Nightwatch configuration\n├── nightwatch\u002F\n│   ├── tests\u002F                      # Test spec files\n│   │   ├── auth\u002F\n│   │   │   ├── login.ts\n│   │   │   └── registration.ts\n│   │   ├── checkout\u002F\n│   │   │   └── purchase-flow.ts\n│   │   └── search\u002F\n│   │       └── product-search.ts\n│   ├── page-objects\u002F               # Page Object definitions\n│   │   ├── loginPage.ts\n│   │   ├── dashboardPage.ts\n│   │   └── checkoutPage.ts\n│   ├── custom-commands\u002F            # Reusable custom commands\n│   │   ├── loginViaApi.ts\n│   │   └── clearSession.ts\n│   ├── custom-assertions\u002F          # Custom assertion definitions\n│   │   └── elementHasCount.ts\n│   ├── globals\u002F                    # Global hooks and settings\n│   │   └── globals.ts\n│   └── fixtures\u002F                   # Test data\n│       └── users.json\n├── reports\u002F                        # Test reports output\n├── screenshots\u002F                    # Failure screenshots\n└── package.json\n```\n\n## Configuration\n\n### nightwatch.conf.js\n\n```javascript\nmodule.exports = {\n  src_folders: ['nightwatch\u002Ftests'],\n  page_objects_path: ['nightwatch\u002Fpage-objects'],\n  custom_commands_path: ['nightwatch\u002Fcustom-commands'],\n  custom_assertions_path: ['nightwatch\u002Fcustom-assertions'],\n  globals_path: 'nightwatch\u002Fglobals\u002Fglobals.js',\n\n  webdriver: {},\n  test_workers: {\n    enabled: true,\n    workers: 'auto',\n  },\n  test_settings: {\n    default: {\n      disable_error_log: false,\n      launch_url: process.env.BASE_URL || 'http:\u002F\u002Flocalhost:3000',\n      screenshots: {\n        enabled: true,\n        path: 'screenshots',\n        on_failure: true,\n        on_error: true,\n      },\n      desiredCapabilities: {\n        browserName: 'chrome',\n        'goog:chromeOptions': {\n          w3c: true,\n          args: process.env.CI\n            ? ['--headless', '--no-sandbox', '--disable-gpu', '--disable-dev-shm-usage']\n            : [],\n        },\n      },\n      globals: {\n        waitForConditionTimeout: 10000,\n        retryAssertionTimeout: 5000,\n      },\n    },\n    firefox: {\n      desiredCapabilities: {\n        browserName: 'firefox',\n        'moz:firefoxOptions': {\n          args: process.env.CI ? ['--headless'] : [],\n        },\n      },\n    },\n  },\n};\n```\n\n## Page Objects\n\n### Login Page Object\n\n```javascript\nmodule.exports = {\n  url: function () {\n    return `${this.api.launchUrl}\u002Flogin`;\n  },\n  elements: {\n    usernameInput: {\n      selector: '[data-testid=\"username-input\"]',\n    },\n    passwordInput: {\n      selector: '[data-testid=\"password-input\"]',\n    },\n    submitButton: {\n      selector: '[data-testid=\"login-submit\"]',\n    },\n    errorMessage: {\n      selector: '[data-testid=\"login-error\"]',\n    },\n    rememberMeCheckbox: {\n      selector: '[data-testid=\"remember-me\"]',\n    },\n  },\n  commands: [\n    {\n      login(username, password) {\n        return this.waitForElementVisible('@usernameInput')\n          .clearValue('@usernameInput')\n          .setValue('@usernameInput', username)\n          .clearValue('@passwordInput')\n          .setValue('@passwordInput', password)\n          .click('@submitButton');\n      },\n      getErrorText(callback) {\n        return this.waitForElementVisible('@errorMessage').getText('@errorMessage', (result) => {\n          callback(result.value);\n        });\n      },\n    },\n  ],\n};\n```\n\n### Dashboard Page Object\n\n```javascript\nmodule.exports = {\n  url: function () {\n    return `${this.api.launchUrl}\u002Fdashboard`;\n  },\n  elements: {\n    welcomeMessage: '[data-testid=\"welcome-message\"]',\n    userAvatar: '[data-testid=\"user-avatar\"]',\n    logoutButton: '[data-testid=\"logout-btn\"]',\n    widgetContainer: '[data-testid=\"dashboard-widgets\"]',\n    notificationBadge: '[data-testid=\"notification-badge\"]',\n  },\n  commands: [\n    {\n      waitForDashboardLoad() {\n        return this.waitForElementVisible('@welcomeMessage').waitForElementVisible(\n          '@widgetContainer'\n        );\n      },\n      logout() {\n        return this.click('@logoutButton');\n      },\n    },\n  ],\n};\n```\n\n## Writing Tests\n\n### Basic Authentication Test\n\n```javascript\ndescribe('User Authentication', function () {\n  let loginPage;\n  let dashboardPage;\n\n  before(function (browser) {\n    loginPage = browser.page.loginPage();\n    dashboardPage = browser.page.dashboardPage();\n  });\n\n  it('should login with valid credentials', function () {\n    loginPage\n      .navigate()\n      .login('testuser@example.com', 'SecurePass123!')\n      .assert.urlContains('\u002Fdashboard');\n\n    dashboardPage.waitForDashboardLoad().assert.visible('@welcomeMessage');\n  });\n\n  it('should show error with invalid credentials', function (browser) {\n    loginPage.navigate().login('invalid@example.com', 'wrongpassword');\n\n    loginPage.getErrorText(function (text) {\n      browser.assert.ok(text.includes('Invalid email or password'));\n    });\n  });\n\n  it('should validate required fields', function () {\n    loginPage.navigate().click('@submitButton');\n    loginPage.assert.visible('@errorMessage');\n  });\n\n  after(function (browser) {\n    browser.end();\n  });\n});\n```\n\n### Element Assertions\n\n```javascript\ndescribe('Product Listing Page', function () {\n  it('should display products with correct structure', function (browser) {\n    browser\n      .url(`${browser.launchUrl}\u002Fproducts`)\n      .waitForElementVisible('[data-testid=\"product-grid\"]')\n      .assert.elementPresent('[data-testid=\"product-card\"]')\n      .assert.textContains('[data-testid=\"page-title\"]', 'Products')\n      .assert.elementsCount('[data-testid=\"product-card\"]', 12)\n      .assert.attributeContains('[data-testid=\"product-image\"]', 'src', 'https:\u002F\u002F');\n  });\n\n  it('should filter products by category', function (browser) {\n    browser\n      .url(`${browser.launchUrl}\u002Fproducts`)\n      .waitForElementVisible('[data-testid=\"category-filter\"]')\n      .click('[data-testid=\"category-electronics\"]')\n      .waitForElementVisible('[data-testid=\"product-card\"]')\n      .assert.textContains('[data-testid=\"active-filter\"]', 'Electronics');\n\n    browser.elements('css selector', '[data-testid=\"product-card\"]', function (result) {\n      this.assert.ok(result.value.length > 0, 'Should have filtered products');\n    });\n  });\n\n  it('should sort products by price', function (browser) {\n    browser\n      .url(`${browser.launchUrl}\u002Fproducts`)\n      .waitForElementVisible('[data-testid=\"sort-dropdown\"]')\n      .click('[data-testid=\"sort-dropdown\"]')\n      .click('[data-testid=\"sort-price-asc\"]')\n      .pause(500) \u002F\u002F Wait for re-render\n      .assert.textContains('[data-testid=\"sort-dropdown\"]', 'Price: Low to High');\n  });\n});\n```\n\n### Custom Commands\n\n```javascript\n\u002F\u002F nightwatch\u002Fcustom-commands\u002FloginViaApi.js\nmodule.exports = {\n  command: async function (username, password) {\n    const baseUrl = this.api.launchUrl;\n\n    await this.execute(\n      function (url, user, pass) {\n        return fetch(`${url}\u002Fapi\u002Fauth\u002Flogin`, {\n          method: 'POST',\n          headers: { 'Content-Type': 'application\u002Fjson' },\n          body: JSON.stringify({ email: user, password: pass }),\n        })\n          .then((res) => res.json())\n          .then((data) => {\n            document.cookie = `auth_token=${data.token}; path=\u002F`;\n            return data;\n          });\n      },\n      [baseUrl, username, password]\n    );\n\n    return this.refresh();\n  },\n};\n\n\u002F\u002F Usage in tests:\n\u002F\u002F browser.loginViaApi('admin@example.com', 'AdminPass123!')\n\u002F\u002F   .url(`${browser.launchUrl}\u002Fadmin`)\n\u002F\u002F   .assert.visible('[data-testid=\"admin-panel\"]');\n```\n\n### Custom Assertions\n\n```javascript\n\u002F\u002F nightwatch\u002Fcustom-assertions\u002FelementHasCount.js\nexports.assertion = function (selector, expectedCount) {\n  this.message = `Testing if element \u003C${selector}> appears ${expectedCount} times`;\n  this.expected = expectedCount;\n\n  this.pass = function (value) {\n    return value === expectedCount;\n  };\n\n  this.value = function (result) {\n    return result.value.length;\n  };\n\n  this.command = function (callback) {\n    return this.api.elements('css selector', selector, callback);\n  };\n};\n\n\u002F\u002F Usage: browser.assert.elementHasCount('[data-testid=\"cart-item\"]', 3)\n```\n\n### Multi-Browser Testing\n\n```javascript\ndescribe('Cross-Browser Compatibility', function () {\n  it('should render header consistently', function (browser) {\n    browser\n      .url(browser.launchUrl)\n      .waitForElementVisible('[data-testid=\"site-header\"]')\n      .assert.visible('[data-testid=\"logo\"]')\n      .assert.visible('[data-testid=\"nav-menu\"]')\n      .assert.cssProperty('[data-testid=\"site-header\"]', 'display', 'flex');\n  });\n});\n```\n\n## Best Practices\n\n1. **Use Nightwatch's `@element` syntax** from page objects to keep selectors centralized and maintainable. Reference elements as `'@usernameInput'` rather than repeating raw selectors.\n2. **Configure `waitForConditionTimeout` globally** in the `globals` section rather than adding explicit waits to every command.\n3. **Enable `test_workers`** for parallel execution. Set `workers: 'auto'` to use all available CPU cores for maximum throughput.\n4. **Use `assert` for hard assertions** (fail immediately) and `verify` for soft assertions (continue execution and report at the end).\n5. **Capture screenshots on failure** via the `screenshots` configuration. Enable both `on_failure` and `on_error` for comprehensive visual debugging.\n6. **Implement custom commands** for repetitive multi-step operations like API-based login, clearing sessions, or seeding test data.\n7. **Leverage Nightwatch's built-in Selenium manager** -- modern Nightwatch auto-manages browser drivers, eliminating manual driver installation.\n8. **Use `--env` flag for multi-browser runs**: `npx nightwatch --env chrome,firefox` to execute tests across browsers in a single command.\n9. **Structure tests by feature domain** (auth, checkout, search) rather than by page name. This keeps related behavior tests together.\n10. **Set `retryAssertionTimeout`** in globals to automatically retry failing assertions, which handles minor timing issues without explicit waits.\n\n## Anti-Patterns\n\n1. **Using `browser.pause()` for synchronization** -- Arbitrary sleeps make tests slow and unreliable. Use `waitForElementVisible()` or `waitForElementPresent()` instead.\n2. **Writing tests that depend on execution order** -- Tests should be fully independent. Use `before`\u002F`beforeEach` hooks for setup, not prior test results.\n3. **Hardcoding selectors in test files** -- Duplicating selectors across tests means changing one selector requires updating dozens of files. Use page objects.\n4. **Not using page object commands** -- Putting multi-step interactions directly in tests creates duplication. Encapsulate sequences like login flows in page object commands.\n5. **Ignoring test worker compatibility** -- Tests that share global variables or browser state fail when run in parallel. Ensure full isolation.\n6. **Using `.verify` when `.assert` is needed** -- Soft assertions can mask failures. Use `.assert` for critical checks and `.verify` only when continuing execution is truly desired.\n7. **Skipping `browser.end()` in teardown** -- Not closing the browser session causes resource leaks and can make subsequent tests fail.\n8. **Nesting describes too deeply** -- More than two levels of nesting makes tests hard to read and maintain. Keep the hierarchy flat.\n9. **Using complex XPath expressions** -- XPath is slower and harder to maintain than CSS selectors. Only use XPath when CSS cannot express the query.\n10. **Not setting up globals for environment config** -- Hardcoding URLs, timeouts, and credentials in test files prevents running tests across different environments.\n\n## CLI Reference\n\n```bash\n# Run all tests\nnpx nightwatch\n\n# Run specific test file\nnpx nightwatch nightwatch\u002Ftests\u002Fauth\u002Flogin.ts\n\n# Run tests in a specific folder\nnpx nightwatch --group auth\n\n# Run tests matching a tag\nnpx nightwatch --tag smoke\n\n# Run against specific browser\nnpx nightwatch --env firefox\n\n# Run multi-browser\nnpx nightwatch --env chrome,firefox\n\n# Run in parallel\nnpx nightwatch --parallel\n\n# Run with verbose output\nnpx nightwatch --verbose\n\n# Run specific test by name\nnpx nightwatch --testcase \"should login with valid credentials\"\n```\n\n## Setup\n\n```bash\n# Initialize a new Nightwatch project\nnpm init nightwatch@latest\n\n# Or install manually\nnpm install --save-dev nightwatch\n\n# For Chrome testing\nnpm install --save-dev chromedriver\n\n# For TypeScript support\nnpm install --save-dev typescript ts-node @types\u002Fnightwatch\n\n# Create configuration file\nnpx nightwatch --init\n```\n",{"name":5,"tags":24,"agents":32,"author":43,"domains":44,"license":15,"version":46,"languages":47,"frameworks":50,"description":7,"testingTypes":51},[25,26,27,28,29,30,31],"nightwatch","nightwatchjs","selenium","e2e","browser-testing","page-objects","automation",[33,34,35,36,37,38,39,40,41,42],"claude-code","cursor","github-copilot","windsurf","codex","aider","continue","cline","zed","bolt","thetestingacademy",[45],"web","1.0.0",[48,49],"javascript","typescript",[26],[28,52,53],"integration","visual","main","eac438ea9216a7cb8a570cab803eb01eeafc6793","skills\u002Fqa\u002Fnightwatchjs-testing","https:\u002F\u002Fgithub.com\u002FGrupoANDevelopment-m\u002Falberto-ai","https:\u002F\u002Fgithub.com\u002FGrupoANDevelopment-m","https:\u002F\u002Fid-preview--d5bef06d-6c9e-4563-a3d4-a855b9d61610.lovable.app\u002F","Eu sou Antonio B. B. Ndombe \r\nEu sou um Pesquisador e desenvolvedor de sistema autonomia cognitivos, fundador de sistemas ODCs ( organismos digital conscientes)","2026-11-04 06:53:39",{"source":8,"skillName":5,"commands":63,"prompt":73,"zipAvailable":74},[64,67,70],{"tool":65,"command":66},"npx","npx skills add GrupoANDevelopment-m\u002Falberto-ai --skill \"NightwatchJS Testing\"",{"tool":68,"command":69},"bunx","bunx skills add GrupoANDevelopment-m\u002Falberto-ai --skill \"NightwatchJS Testing\"",{"tool":71,"command":72},"pnpm","pnpm dlx skills add GrupoANDevelopment-m\u002Falberto-ai --skill \"NightwatchJS Testing\"","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FGrupoANDevelopment-m\u002Falberto-ai\u002Fblob\u002Fmain\u002Fskills\u002Fqa\u002Fnightwatchjs-testing\u002FSKILL.md",true,[],[77,85,92,99,106,113],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":81,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M7DASC6FSCJP49JZBSK0NY1Z","nemoclaw-user-reference","Describes the NemoClaw integration layer and blueprint architecture and how they orchestrate compatible agent sandboxes. Use when looking up architecture, agent integration, plugin structure, or blueprint design. Trigger keywords - nemoclaw architecture, nemoclaw agent architecture, nemoclaw plugin blueprint structure, nemoclaw vs openshell, which cli, nemoclaw cli, openshell cli, sandbox commands, nemoclaw cli commands, nemoclaw command reference, nemoclaw network policy, sandbox egress control operator approval, nemoclaw troubleshooting, nemoclaw debug sandbox issues.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FGrupoANDevelopment-m\u002Falberto-ai\u002Fblob\u002Fmain\u002Fupstream\u002Fnemoclaw\u002Fskills\u002Fnemoclaw-user-reference\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":81,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M7DAS5S79VK33XFGVAM2TFWF","nemoclaw-user-overview","Explains how OpenClaw, OpenShell, and NemoClaw form the ecosystem, NemoClaw's position in the stack, what NemoClaw adds beyond the community sandbox, and when to prefer NemoClaw versus integrating OpenShell and OpenClaw directly. Use when users ask about the relationship between OpenClaw, OpenShell, and NemoClaw, or when to use NemoClaw versus OpenShell. Trigger keywords - nemoclaw ecosystem, openclaw openshell, nemoclaw vs openshell, sandboxed openclaw, how nemoclaw works, nemoclaw sandbox lifecycle blueprint, nemoclaw overview, openclaw always-on assistants, nvidia openshell, nvidia nemotron, nemoclaw release notes, nemoclaw changelog.","https:\u002F\u002Fgithub.com\u002FGrupoANDevelopment-m\u002Falberto-ai\u002Fblob\u002Fmain\u002Fupstream\u002Fnemoclaw\u002Fskills\u002Fnemoclaw-user-overview\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":81,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":19},"01M7DAS0PQEMET5MNGZ1ABSZVS","nemoclaw-user-monitor-sandbox","Inspects sandbox health, traces agent behavior, and diagnoses problems. Use when monitoring a running sandbox, debugging agent issues, or checking sandbox logs. Trigger keywords - monitor nemoclaw sandbox, debug nemoclaw agent issues.","https:\u002F\u002Fgithub.com\u002FGrupoANDevelopment-m\u002Falberto-ai\u002Fblob\u002Fmain\u002Fupstream\u002Fnemoclaw\u002Fskills\u002Fnemoclaw-user-monitor-sandbox\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":81,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":19},"01M7DARQYGF7E9A69VH6S3CGN9","nemoclaw-user-manage-sandboxes","Explains operational tasks after the quickstart: listing sandboxes, status and health checks, logs, diagnostics, port forwards, multiple sandboxes, credential reset, rebuilds, network presets, upgrades, and uninstall. Trigger keywords - manage nemoclaw sandboxes, nemoclaw status, nemoclaw list, nemoclaw dashboard port, nemoclaw rebuild, nemoclaw upgrade sandboxes, nemoclaw uninstall, sandbox mutability, sandbox runtime configuration, sandbox rebuild, nemoclaw backup, nemoclaw restore, workspace backup, openshell sandbox download upload, nemoclaw messaging channels, nemoclaw telegram, nemoclaw discord, nemoclaw slack, nemoclaw wechat, nemoclaw whatsapp, openshell channel messaging, nemoclaw workspace files, soul.md, user.md, identity.md, agents.md, sandbox persistence.","https:\u002F\u002Fgithub.com\u002FGrupoANDevelopment-m\u002Falberto-ai\u002Fblob\u002Fmain\u002Fupstream\u002Fnemoclaw\u002Fskills\u002Fnemoclaw-user-manage-sandboxes\u002FSKILL.md",[],[],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":81,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":19},"01M7DARH8BRTG51TRCAB7YWDJ4","nemoclaw-user-manage-policy","Adds, removes, or modifies allowed endpoints in the sandbox policy. Use when customizing network policy, changing egress rules, or configuring sandbox endpoint access. Trigger keywords - customize nemoclaw network policy, sandbox egress policy configuration, nemoclaw integration policy examples, post-install policy setup, openshell approval workflow, policy preset, nemoclaw approve network requests, sandbox egress approval tui.","https:\u002F\u002Fgithub.com\u002FGrupoANDevelopment-m\u002Falberto-ai\u002Fblob\u002Fmain\u002Fupstream\u002Fnemoclaw\u002Fskills\u002Fnemoclaw-user-manage-policy\u002FSKILL.md",[],[],{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":81,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":19},"01M7DARAT62M2VR37590VCZ5NS","nemoclaw-user-get-started","Installs NemoClaw, launches a sandbox, and runs the first agent prompt. Use when onboarding, installing, or launching a NemoClaw sandbox for the first time. Trigger keywords - nemoclaw quickstart, install nemoclaw openclaw sandbox, nemohermes quickstart, hermes agent nemoclaw, run hermes openshell sandbox, nemoclaw prerequisites, nemoclaw supported platforms, nemoclaw hardware software, nemoclaw windows wsl2 setup, nemoclaw install windows docker desktop.","https:\u002F\u002Fgithub.com\u002FGrupoANDevelopment-m\u002Falberto-ai\u002Fblob\u002Fmain\u002Fupstream\u002Fnemoclaw\u002Fskills\u002Fnemoclaw-user-get-started\u002FSKILL.md",[],[]]