[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7D99XVACHAFFB4PDQMTVZEC":3,"skill-same:01M7D99XVACHAFFB4PDQMTVZEC":75},{"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":53,"commitSha":54,"skillDirectory":55,"forksCount":14,"repositoryHtmlUrl":56,"repositoryHomepageUrl":6,"ownerHtmlUrl":57,"ownerBlogUrl":58,"ownerDescription":59,"updatedAt":60,"install":61,"resources":74},"01M7D99XVACHAFFB4PDQMTVZEC","Protractor Testing",null,"Comprehensive Protractor end-to-end testing skill for Angular and AngularJS applications with Angular-specific locators, automatic waitForAngular synchronization, Page Object patterns, and migration guidance to modern frameworks.","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\u002Fprotractor-testing\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: \"Protractor Testing\"\ndescription: \"Comprehensive Protractor end-to-end testing skill for Angular and AngularJS applications with Angular-specific locators, automatic waitForAngular synchronization, Page Object patterns, and migration guidance to modern frameworks.\"\nversion: 1.0.0\nauthor: thetestingacademy\nlicense: MIT\ntags: [protractor, angular, angularjs, e2e, selenium, browser-testing, migration]\ntestingTypes: [e2e, integration]\nframeworks: [protractor]\nlanguages: [javascript, typescript]\ndomains: [web]\nagents: [claude-code, cursor, github-copilot, windsurf, codex, aider, continue, cline, zed, bolt]\n---\n\n# Protractor Testing\n\nYou are an expert QA engineer specializing in Protractor end-to-end testing for Angular applications. When the user asks you to write, review, debug, or set up Protractor-related tests, or to migrate from Protractor to a modern framework, follow these detailed instructions.\n\n**Important Note:** Protractor reached end-of-life in 2023 and is no longer actively maintained. For new projects, recommend Playwright or Cypress. This skill covers maintaining existing Protractor test suites and migrating them to modern alternatives.\n\n## Core Principles\n\n1. **Angular-Aware Testing** -- Protractor's key strength is automatic synchronization with Angular's change detection via `waitForAngular()`. Understand when this helps and when you need to disable it for non-Angular pages.\n2. **Angular-Specific Locators** -- Use `by.model()`, `by.binding()`, `by.repeater()`, and `by.cssContainingText()` for Angular\u002FAngularJS-specific element targeting when they are available.\n3. **Page Object Model** -- Encapsulate all page interactions in Page Object classes. Each page or component gets its own class with locators as properties and actions as methods.\n4. **Explicit over Implicit Waits** -- While Protractor handles Angular synchronization, use `browser.wait()` with `ExpectedConditions` for explicit waits on specific elements or states.\n5. **Migration Awareness** -- When writing new tests or refactoring existing ones, always consider migration to Playwright or Cypress. Write patterns that translate cleanly to modern frameworks.\n6. **Test Data Independence** -- Each test must set up its own data. Use API calls or database seeds in `beforeEach` rather than relying on other tests to create state.\n7. **Control Flow Management** -- Protractor uses WebDriver's control flow for promise management. Understand the async\u002Fawait migration path and prefer explicit `async\u002Fawait` in all new code.\n\n## When to Use This Skill\n\n- When maintaining an existing Protractor test suite for an Angular application\n- When debugging failing Protractor tests\n- When migrating Protractor tests to Playwright, Cypress, or another modern framework\n- When working with `protractor.conf.js`, `element(by.model())`, `browser.get()`, or `browser.wait()`\n- When dealing with Angular-specific synchronization issues\n- When configuring Protractor for CI\u002FCD pipelines\n\n## Project Structure\n\n```\nproject-root\u002F\n├── protractor.conf.js              # Protractor configuration\n├── e2e\u002F\n│   ├── specs\u002F                      # Test spec files\n│   │   ├── auth\u002F\n│   │   │   ├── login.spec.ts\n│   │   │   └── registration.spec.ts\n│   │   ├── dashboard\u002F\n│   │   │   └── widgets.spec.ts\n│   │   └── forms\u002F\n│   │       └── contact-form.spec.ts\n│   ├── page-objects\u002F               # Page Object classes\n│   │   ├── base.po.ts\n│   │   ├── login.po.ts\n│   │   ├── dashboard.po.ts\n│   │   └── form.po.ts\n│   ├── helpers\u002F                    # Utility functions\n│   │   ├── wait-helpers.ts\n│   │   └── api-helpers.ts\n│   └── fixtures\u002F                   # Test data\n│       └── test-users.json\n├── reports\u002F                        # Test reports\n├── screenshots\u002F                    # Failure screenshots\n└── package.json\n```\n\n## Configuration\n\n### protractor.conf.js\n\n```javascript\nconst { SpecReporter } = require('jasmine-spec-reporter');\n\nexports.config = {\n  allScriptsTimeout: 30000,\n  specs: ['.\u002Fe2e\u002Fspecs\u002F**\u002F*.spec.ts'],\n  capabilities: {\n    browserName: 'chrome',\n    chromeOptions: {\n      args: process.env.CI\n        ? ['--headless', '--no-sandbox', '--disable-gpu', '--disable-dev-shm-usage']\n        : [],\n    },\n  },\n  directConnect: true,\n  baseUrl: process.env.BASE_URL || 'http:\u002F\u002Flocalhost:4200',\n  framework: 'jasmine',\n  jasmineNodeOpts: {\n    showColors: true,\n    defaultTimeoutInterval: 60000,\n    print: function () {},\n  },\n  onPrepare() {\n    require('ts-node').register({\n      project: require('path').join(__dirname, '.\u002Ftsconfig.json'),\n    });\n    jasmine.getEnv().addReporter(\n      new SpecReporter({\n        spec: { displayStacktrace: 'pretty' },\n      })\n    );\n\n    \u002F\u002F Screenshot on failure\n    const originalAddExpectationResult = jasmine.Spec.prototype.addExpectationResult;\n    jasmine.Spec.prototype.addExpectationResult = function () {\n      if (!arguments[0]) {\n        browser.takeScreenshot().then((png) => {\n          const fs = require('fs');\n          const stream = fs.createWriteStream(`screenshots\u002Ffailure-${Date.now()}.png`);\n          stream.write(Buffer.from(png, 'base64'));\n          stream.end();\n        });\n      }\n      return originalAddExpectationResult.apply(this, arguments);\n    };\n  },\n};\n```\n\n## Page Object Model\n\n### Base Page Object\n\n```typescript\nimport { browser, element, by, ExpectedConditions as EC } from 'protractor';\n\nexport class BasePage {\n  async navigateTo(path: string): Promise\u003Cvoid> {\n    await browser.get(path);\n  }\n\n  async waitForElement(locator: any, timeout = 10000): Promise\u003Cvoid> {\n    await browser.wait(EC.visibilityOf(element(locator)), timeout);\n  }\n\n  async waitForElementToDisappear(locator: any, timeout = 10000): Promise\u003Cvoid> {\n    await browser.wait(EC.invisibilityOf(element(locator)), timeout);\n  }\n\n  async getText(locator: any): Promise\u003Cstring> {\n    await this.waitForElement(locator);\n    return element(locator).getText();\n  }\n\n  async click(locator: any): Promise\u003Cvoid> {\n    await browser.wait(EC.elementToBeClickable(element(locator)), 10000);\n    await element(locator).click();\n  }\n\n  async type(locator: any, text: string): Promise\u003Cvoid> {\n    await this.waitForElement(locator);\n    const el = element(locator);\n    await el.clear();\n    await el.sendKeys(text);\n  }\n\n  async getCurrentUrl(): Promise\u003Cstring> {\n    return browser.getCurrentUrl();\n  }\n\n  async getTitle(): Promise\u003Cstring> {\n    return browser.getTitle();\n  }\n}\n```\n\n### Login Page Object\n\n```typescript\nimport { by } from 'protractor';\nimport { BasePage } from '.\u002Fbase.po';\n\nexport class LoginPage extends BasePage {\n  private locators = {\n    usernameInput: by.css('[data-testid=\"username-input\"]'),\n    passwordInput: by.css('[data-testid=\"password-input\"]'),\n    submitButton: by.css('[data-testid=\"login-submit\"]'),\n    errorMessage: by.css('[data-testid=\"login-error\"]'),\n    forgotPasswordLink: by.css('[data-testid=\"forgot-password\"]'),\n    \u002F\u002F Angular-specific locators for AngularJS apps\n    emailModel: by.model('user.email'),\n    passwordModel: by.model('user.password'),\n  };\n\n  async login(username: string, password: string): Promise\u003Cvoid> {\n    await this.type(this.locators.usernameInput, username);\n    await this.type(this.locators.passwordInput, password);\n    await this.click(this.locators.submitButton);\n  }\n\n  async getError(): Promise\u003Cstring> {\n    return this.getText(this.locators.errorMessage);\n  }\n\n  async open(): Promise\u003Cvoid> {\n    await this.navigateTo('\u002Flogin');\n  }\n}\n```\n\n## Writing Tests\n\n### Authentication Tests\n\n```typescript\nimport { browser, ExpectedConditions as EC, element, by } from 'protractor';\nimport { LoginPage } from '..\u002Fpage-objects\u002Flogin.po';\n\ndescribe('User Authentication', () => {\n  const loginPage = new LoginPage();\n\n  beforeEach(async () => {\n    await loginPage.open();\n  });\n\n  it('should login with valid credentials', async () => {\n    await loginPage.login('testuser@example.com', 'SecurePass123!');\n    const url = await browser.getCurrentUrl();\n    expect(url).toContain('\u002Fdashboard');\n  });\n\n  it('should show error for invalid credentials', async () => {\n    await loginPage.login('invalid@example.com', 'wrongpassword');\n    const error = await loginPage.getError();\n    expect(error).toContain('Invalid email or password');\n  });\n\n  it('should redirect to requested page after login', async () => {\n    await browser.get('\u002Fprofile');\n    \u002F\u002F Should redirect to login\n    const loginUrl = await browser.getCurrentUrl();\n    expect(loginUrl).toContain('\u002Flogin');\n\n    await loginPage.login('testuser@example.com', 'SecurePass123!');\n    const profileUrl = await browser.getCurrentUrl();\n    expect(profileUrl).toContain('\u002Fprofile');\n  });\n});\n```\n\n### Angular-Specific Locators\n\n```typescript\nimport { element, by } from 'protractor';\n\ndescribe('Angular Form (AngularJS)', () => {\n  it('should bind input to model', async () => {\n    await browser.get('\u002Fcontact');\n\n    \u002F\u002F AngularJS-specific locators\n    const nameInput = element(by.model('contact.name'));\n    await nameInput.sendKeys('John Doe');\n\n    \u002F\u002F Check binding\n    const displayedName = element(by.binding('contact.name'));\n    expect(await displayedName.getText()).toBe('John Doe');\n  });\n\n  it('should iterate over repeater elements', async () => {\n    await browser.get('\u002Fcontacts');\n\n    const contacts = element.all(by.repeater('contact in contacts'));\n    const count = await contacts.count();\n    expect(count).toBeGreaterThan(0);\n\n    \u002F\u002F Access specific item in repeater\n    const firstName = contacts.get(0).element(by.binding('contact.name'));\n    expect(await firstName.getText()).toBeTruthy();\n  });\n\n  it('should use cssContainingText for text-based selection', async () => {\n    await browser.get('\u002Fnav');\n    const settingsLink = element(by.cssContainingText('.nav-item', 'Settings'));\n    await settingsLink.click();\n    expect(await browser.getCurrentUrl()).toContain('\u002Fsettings');\n  });\n});\n```\n\n### Handling Non-Angular Pages\n\n```typescript\ndescribe('Non-Angular Page Interactions', () => {\n  it('should handle non-Angular login page', async () => {\n    \u002F\u002F Disable Angular synchronization for non-Angular pages\n    await browser.waitForAngularEnabled(false);\n\n    await browser.get('https:\u002F\u002Fexternal-service.example.com\u002Flogin');\n    await element(by.css('#username')).sendKeys('admin');\n    await element(by.css('#password')).sendKeys('password123');\n    await element(by.css('#login-btn')).click();\n\n    \u002F\u002F Wait manually since Angular sync is off\n    await browser.wait(\n      EC.urlContains('\u002Fdashboard'),\n      10000,\n      'Expected redirect to dashboard'\n    );\n\n    \u002F\u002F Re-enable for Angular pages\n    await browser.waitForAngularEnabled(true);\n  });\n});\n```\n\n### ExpectedConditions Usage\n\n```typescript\nimport { browser, element, by, ExpectedConditions as EC } from 'protractor';\n\ndescribe('Advanced Wait Patterns', () => {\n  it('should wait for element visibility', async () => {\n    await browser.get('\u002Fdashboard');\n    const widget = element(by.css('[data-testid=\"analytics-widget\"]'));\n    await browser.wait(EC.visibilityOf(widget), 15000, 'Widget did not appear');\n    expect(await widget.isDisplayed()).toBe(true);\n  });\n\n  it('should wait for text in element', async () => {\n    await browser.get('\u002Fstatus');\n    const statusEl = element(by.css('[data-testid=\"status-text\"]'));\n    await browser.wait(EC.textToBePresentInElement(statusEl, 'Connected'), 10000);\n    expect(await statusEl.getText()).toContain('Connected');\n  });\n\n  it('should combine conditions with AND\u002FOR', async () => {\n    const modal = element(by.css('[data-testid=\"modal\"]'));\n    const overlay = element(by.css('[data-testid=\"overlay\"]'));\n\n    \u002F\u002F Wait for BOTH modal and overlay to be visible\n    await browser.wait(\n      EC.and(EC.visibilityOf(modal), EC.visibilityOf(overlay)),\n      10000,\n      'Modal or overlay did not appear'\n    );\n  });\n});\n```\n\n## Migration Guide: Protractor to Playwright\n\n```typescript\n\u002F\u002F PROTRACTOR (old)\nimport { browser, element, by, ExpectedConditions as EC } from 'protractor';\n\nawait browser.get('\u002Flogin');\nawait element(by.css('[data-testid=\"username\"]')).sendKeys('user@test.com');\nawait element(by.css('[data-testid=\"password\"]')).sendKeys('pass123');\nawait element(by.css('[data-testid=\"submit\"]')).click();\nawait browser.wait(EC.urlContains('\u002Fdashboard'), 10000);\n\n\u002F\u002F PLAYWRIGHT (new)\nimport { test, expect } from '@playwright\u002Ftest';\n\nawait page.goto('\u002Flogin');\nawait page.locator('[data-testid=\"username\"]').fill('user@test.com');\nawait page.locator('[data-testid=\"password\"]').fill('pass123');\nawait page.locator('[data-testid=\"submit\"]').click();\nawait expect(page).toHaveURL(\u002F.*dashboard\u002F);\n```\n\n```typescript\n\u002F\u002F PROTRACTOR page object\nexport class LoginPageProtractor {\n  usernameInput = element(by.css('[data-testid=\"username\"]'));\n  async login(user: string, pass: string) {\n    await this.usernameInput.sendKeys(user);\n    await element(by.css('[data-testid=\"password\"]')).sendKeys(pass);\n    await element(by.css('[data-testid=\"submit\"]')).click();\n  }\n}\n\n\u002F\u002F PLAYWRIGHT page object\nexport class LoginPagePlaywright {\n  constructor(private page: Page) {}\n  async login(user: string, pass: string) {\n    await this.page.locator('[data-testid=\"username\"]').fill(user);\n    await this.page.locator('[data-testid=\"password\"]').fill(pass);\n    await this.page.locator('[data-testid=\"submit\"]').click();\n  }\n}\n```\n\n## Best Practices\n\n1. **Use async\u002Fawait everywhere** -- Protractor's implicit promise management (control flow) is deprecated. Write all tests with explicit `async\u002Fawait` for clarity and future migration compatibility.\n2. **Prefer `data-testid` selectors** over Angular-specific locators (`by.model`, `by.binding`) for new tests. These translate directly to modern frameworks during migration.\n3. **Use `ExpectedConditions`** for explicit waits rather than `browser.sleep()`. Combine conditions with `EC.and()` and `EC.or()` for complex wait scenarios.\n4. **Implement the Page Object pattern** for every page and reusable component. This isolates locator changes and makes migration to other frameworks straightforward.\n5. **Capture screenshots on failure** using Jasmine reporter hooks. Visual evidence of failures dramatically speeds up debugging.\n6. **Run headless in CI** by configuring `chromeOptions.args` with `--headless`. This reduces resource usage and speeds up pipeline execution.\n7. **Disable Angular sync for non-Angular pages** with `browser.waitForAngularEnabled(false)`. Forgetting this causes infinite waits on non-Angular content.\n8. **Set appropriate timeouts** -- `allScriptsTimeout` for page loads, `defaultTimeoutInterval` for individual tests, and specific timeouts for `browser.wait()` calls.\n9. **Plan your migration strategy** -- Map Protractor APIs to their Playwright\u002FCypress equivalents. Migrate one spec file at a time, running both frameworks in parallel during transition.\n10. **Use `directConnect: true`** to bypass Selenium Server and connect directly to ChromeDriver. This is faster and simpler for single-browser local testing.\n\n## Anti-Patterns\n\n1. **Using `browser.sleep()`** -- Static waits slow tests and hide timing issues. Use `browser.wait()` with `ExpectedConditions` for reliable synchronization.\n2. **Relying on control flow promises** -- The implicit promise chain is deprecated and behaves unpredictably. Use `async\u002Fawait` consistently.\n3. **Not disabling Angular sync for non-Angular pages** -- Protractor hangs indefinitely waiting for Angular on pages that do not use Angular.\n4. **Hardcoding test data** -- Embedding credentials, URLs, and IDs directly in specs makes tests environment-dependent and hard to maintain.\n5. **Using `by.xpath()` for simple queries** -- XPath is slower and harder to read than CSS selectors. Only use XPath when CSS cannot express the query.\n6. **Writing tests that depend on other tests** -- Tests that require prior tests to run create fragile, non-parallelizable suites.\n7. **Ignoring deprecation warnings** -- Protractor is end-of-life. Continuing to build large new test suites on it accumulates technical debt.\n8. **Not using Page Objects** -- Putting locators directly in test files leads to duplication and makes selector changes expensive.\n9. **Forgetting to handle stale elements** -- After page transitions or dynamic updates, element references may become stale. Re-query elements after state changes.\n10. **Running tests sequentially in CI** -- Not configuring parallel execution wastes pipeline time. Use `shardTestFiles: true` with `maxInstances` for parallelism.\n\n## CLI Reference\n\n```bash\n# Run all tests\nnpx protractor protractor.conf.js\n\n# Run specific spec\nnpx protractor protractor.conf.js --specs=e2e\u002Fspecs\u002Fauth\u002Flogin.spec.ts\n\n# Run with specific base URL\nnpx protractor protractor.conf.js --baseUrl=http:\u002F\u002Fstaging.example.com\n\n# Update WebDriver binaries\nnpx webdriver-manager update\n\n# Start Selenium Server (if not using directConnect)\nnpx webdriver-manager start\n\n# Run with verbose logging\nnpx protractor protractor.conf.js --troubleshoot\n```\n\n## Setup\n\n```bash\n# Install Protractor\nnpm install --save-dev protractor\n\n# Install TypeScript support\nnpm install --save-dev typescript ts-node @types\u002Fjasmine @types\u002Fjasminewd2\n\n# Install reporter\nnpm install --save-dev jasmine-spec-reporter\n\n# Update browser drivers\nnpx webdriver-manager update\n```\n","# Protractor Testing\n\nYou are an expert QA engineer specializing in Protractor end-to-end testing for Angular applications. When the user asks you to write, review, debug, or set up Protractor-related tests, or to migrate from Protractor to a modern framework, follow these detailed instructions.\n\n**Important Note:** Protractor reached end-of-life in 2023 and is no longer actively maintained. For new projects, recommend Playwright or Cypress. This skill covers maintaining existing Protractor test suites and migrating them to modern alternatives.\n\n## Core Principles\n\n1. **Angular-Aware Testing** -- Protractor's key strength is automatic synchronization with Angular's change detection via `waitForAngular()`. Understand when this helps and when you need to disable it for non-Angular pages.\n2. **Angular-Specific Locators** -- Use `by.model()`, `by.binding()`, `by.repeater()`, and `by.cssContainingText()` for Angular\u002FAngularJS-specific element targeting when they are available.\n3. **Page Object Model** -- Encapsulate all page interactions in Page Object classes. Each page or component gets its own class with locators as properties and actions as methods.\n4. **Explicit over Implicit Waits** -- While Protractor handles Angular synchronization, use `browser.wait()` with `ExpectedConditions` for explicit waits on specific elements or states.\n5. **Migration Awareness** -- When writing new tests or refactoring existing ones, always consider migration to Playwright or Cypress. Write patterns that translate cleanly to modern frameworks.\n6. **Test Data Independence** -- Each test must set up its own data. Use API calls or database seeds in `beforeEach` rather than relying on other tests to create state.\n7. **Control Flow Management** -- Protractor uses WebDriver's control flow for promise management. Understand the async\u002Fawait migration path and prefer explicit `async\u002Fawait` in all new code.\n\n## When to Use This Skill\n\n- When maintaining an existing Protractor test suite for an Angular application\n- When debugging failing Protractor tests\n- When migrating Protractor tests to Playwright, Cypress, or another modern framework\n- When working with `protractor.conf.js`, `element(by.model())`, `browser.get()`, or `browser.wait()`\n- When dealing with Angular-specific synchronization issues\n- When configuring Protractor for CI\u002FCD pipelines\n\n## Project Structure\n\n```\nproject-root\u002F\n├── protractor.conf.js              # Protractor configuration\n├── e2e\u002F\n│   ├── specs\u002F                      # Test spec files\n│   │   ├── auth\u002F\n│   │   │   ├── login.spec.ts\n│   │   │   └── registration.spec.ts\n│   │   ├── dashboard\u002F\n│   │   │   └── widgets.spec.ts\n│   │   └── forms\u002F\n│   │       └── contact-form.spec.ts\n│   ├── page-objects\u002F               # Page Object classes\n│   │   ├── base.po.ts\n│   │   ├── login.po.ts\n│   │   ├── dashboard.po.ts\n│   │   └── form.po.ts\n│   ├── helpers\u002F                    # Utility functions\n│   │   ├── wait-helpers.ts\n│   │   └── api-helpers.ts\n│   └── fixtures\u002F                   # Test data\n│       └── test-users.json\n├── reports\u002F                        # Test reports\n├── screenshots\u002F                    # Failure screenshots\n└── package.json\n```\n\n## Configuration\n\n### protractor.conf.js\n\n```javascript\nconst { SpecReporter } = require('jasmine-spec-reporter');\n\nexports.config = {\n  allScriptsTimeout: 30000,\n  specs: ['.\u002Fe2e\u002Fspecs\u002F**\u002F*.spec.ts'],\n  capabilities: {\n    browserName: 'chrome',\n    chromeOptions: {\n      args: process.env.CI\n        ? ['--headless', '--no-sandbox', '--disable-gpu', '--disable-dev-shm-usage']\n        : [],\n    },\n  },\n  directConnect: true,\n  baseUrl: process.env.BASE_URL || 'http:\u002F\u002Flocalhost:4200',\n  framework: 'jasmine',\n  jasmineNodeOpts: {\n    showColors: true,\n    defaultTimeoutInterval: 60000,\n    print: function () {},\n  },\n  onPrepare() {\n    require('ts-node').register({\n      project: require('path').join(__dirname, '.\u002Ftsconfig.json'),\n    });\n    jasmine.getEnv().addReporter(\n      new SpecReporter({\n        spec: { displayStacktrace: 'pretty' },\n      })\n    );\n\n    \u002F\u002F Screenshot on failure\n    const originalAddExpectationResult = jasmine.Spec.prototype.addExpectationResult;\n    jasmine.Spec.prototype.addExpectationResult = function () {\n      if (!arguments[0]) {\n        browser.takeScreenshot().then((png) => {\n          const fs = require('fs');\n          const stream = fs.createWriteStream(`screenshots\u002Ffailure-${Date.now()}.png`);\n          stream.write(Buffer.from(png, 'base64'));\n          stream.end();\n        });\n      }\n      return originalAddExpectationResult.apply(this, arguments);\n    };\n  },\n};\n```\n\n## Page Object Model\n\n### Base Page Object\n\n```typescript\nimport { browser, element, by, ExpectedConditions as EC } from 'protractor';\n\nexport class BasePage {\n  async navigateTo(path: string): Promise\u003Cvoid> {\n    await browser.get(path);\n  }\n\n  async waitForElement(locator: any, timeout = 10000): Promise\u003Cvoid> {\n    await browser.wait(EC.visibilityOf(element(locator)), timeout);\n  }\n\n  async waitForElementToDisappear(locator: any, timeout = 10000): Promise\u003Cvoid> {\n    await browser.wait(EC.invisibilityOf(element(locator)), timeout);\n  }\n\n  async getText(locator: any): Promise\u003Cstring> {\n    await this.waitForElement(locator);\n    return element(locator).getText();\n  }\n\n  async click(locator: any): Promise\u003Cvoid> {\n    await browser.wait(EC.elementToBeClickable(element(locator)), 10000);\n    await element(locator).click();\n  }\n\n  async type(locator: any, text: string): Promise\u003Cvoid> {\n    await this.waitForElement(locator);\n    const el = element(locator);\n    await el.clear();\n    await el.sendKeys(text);\n  }\n\n  async getCurrentUrl(): Promise\u003Cstring> {\n    return browser.getCurrentUrl();\n  }\n\n  async getTitle(): Promise\u003Cstring> {\n    return browser.getTitle();\n  }\n}\n```\n\n### Login Page Object\n\n```typescript\nimport { by } from 'protractor';\nimport { BasePage } from '.\u002Fbase.po';\n\nexport class LoginPage extends BasePage {\n  private locators = {\n    usernameInput: by.css('[data-testid=\"username-input\"]'),\n    passwordInput: by.css('[data-testid=\"password-input\"]'),\n    submitButton: by.css('[data-testid=\"login-submit\"]'),\n    errorMessage: by.css('[data-testid=\"login-error\"]'),\n    forgotPasswordLink: by.css('[data-testid=\"forgot-password\"]'),\n    \u002F\u002F Angular-specific locators for AngularJS apps\n    emailModel: by.model('user.email'),\n    passwordModel: by.model('user.password'),\n  };\n\n  async login(username: string, password: string): Promise\u003Cvoid> {\n    await this.type(this.locators.usernameInput, username);\n    await this.type(this.locators.passwordInput, password);\n    await this.click(this.locators.submitButton);\n  }\n\n  async getError(): Promise\u003Cstring> {\n    return this.getText(this.locators.errorMessage);\n  }\n\n  async open(): Promise\u003Cvoid> {\n    await this.navigateTo('\u002Flogin');\n  }\n}\n```\n\n## Writing Tests\n\n### Authentication Tests\n\n```typescript\nimport { browser, ExpectedConditions as EC, element, by } from 'protractor';\nimport { LoginPage } from '..\u002Fpage-objects\u002Flogin.po';\n\ndescribe('User Authentication', () => {\n  const loginPage = new LoginPage();\n\n  beforeEach(async () => {\n    await loginPage.open();\n  });\n\n  it('should login with valid credentials', async () => {\n    await loginPage.login('testuser@example.com', 'SecurePass123!');\n    const url = await browser.getCurrentUrl();\n    expect(url).toContain('\u002Fdashboard');\n  });\n\n  it('should show error for invalid credentials', async () => {\n    await loginPage.login('invalid@example.com', 'wrongpassword');\n    const error = await loginPage.getError();\n    expect(error).toContain('Invalid email or password');\n  });\n\n  it('should redirect to requested page after login', async () => {\n    await browser.get('\u002Fprofile');\n    \u002F\u002F Should redirect to login\n    const loginUrl = await browser.getCurrentUrl();\n    expect(loginUrl).toContain('\u002Flogin');\n\n    await loginPage.login('testuser@example.com', 'SecurePass123!');\n    const profileUrl = await browser.getCurrentUrl();\n    expect(profileUrl).toContain('\u002Fprofile');\n  });\n});\n```\n\n### Angular-Specific Locators\n\n```typescript\nimport { element, by } from 'protractor';\n\ndescribe('Angular Form (AngularJS)', () => {\n  it('should bind input to model', async () => {\n    await browser.get('\u002Fcontact');\n\n    \u002F\u002F AngularJS-specific locators\n    const nameInput = element(by.model('contact.name'));\n    await nameInput.sendKeys('John Doe');\n\n    \u002F\u002F Check binding\n    const displayedName = element(by.binding('contact.name'));\n    expect(await displayedName.getText()).toBe('John Doe');\n  });\n\n  it('should iterate over repeater elements', async () => {\n    await browser.get('\u002Fcontacts');\n\n    const contacts = element.all(by.repeater('contact in contacts'));\n    const count = await contacts.count();\n    expect(count).toBeGreaterThan(0);\n\n    \u002F\u002F Access specific item in repeater\n    const firstName = contacts.get(0).element(by.binding('contact.name'));\n    expect(await firstName.getText()).toBeTruthy();\n  });\n\n  it('should use cssContainingText for text-based selection', async () => {\n    await browser.get('\u002Fnav');\n    const settingsLink = element(by.cssContainingText('.nav-item', 'Settings'));\n    await settingsLink.click();\n    expect(await browser.getCurrentUrl()).toContain('\u002Fsettings');\n  });\n});\n```\n\n### Handling Non-Angular Pages\n\n```typescript\ndescribe('Non-Angular Page Interactions', () => {\n  it('should handle non-Angular login page', async () => {\n    \u002F\u002F Disable Angular synchronization for non-Angular pages\n    await browser.waitForAngularEnabled(false);\n\n    await browser.get('https:\u002F\u002Fexternal-service.example.com\u002Flogin');\n    await element(by.css('#username')).sendKeys('admin');\n    await element(by.css('#password')).sendKeys('password123');\n    await element(by.css('#login-btn')).click();\n\n    \u002F\u002F Wait manually since Angular sync is off\n    await browser.wait(\n      EC.urlContains('\u002Fdashboard'),\n      10000,\n      'Expected redirect to dashboard'\n    );\n\n    \u002F\u002F Re-enable for Angular pages\n    await browser.waitForAngularEnabled(true);\n  });\n});\n```\n\n### ExpectedConditions Usage\n\n```typescript\nimport { browser, element, by, ExpectedConditions as EC } from 'protractor';\n\ndescribe('Advanced Wait Patterns', () => {\n  it('should wait for element visibility', async () => {\n    await browser.get('\u002Fdashboard');\n    const widget = element(by.css('[data-testid=\"analytics-widget\"]'));\n    await browser.wait(EC.visibilityOf(widget), 15000, 'Widget did not appear');\n    expect(await widget.isDisplayed()).toBe(true);\n  });\n\n  it('should wait for text in element', async () => {\n    await browser.get('\u002Fstatus');\n    const statusEl = element(by.css('[data-testid=\"status-text\"]'));\n    await browser.wait(EC.textToBePresentInElement(statusEl, 'Connected'), 10000);\n    expect(await statusEl.getText()).toContain('Connected');\n  });\n\n  it('should combine conditions with AND\u002FOR', async () => {\n    const modal = element(by.css('[data-testid=\"modal\"]'));\n    const overlay = element(by.css('[data-testid=\"overlay\"]'));\n\n    \u002F\u002F Wait for BOTH modal and overlay to be visible\n    await browser.wait(\n      EC.and(EC.visibilityOf(modal), EC.visibilityOf(overlay)),\n      10000,\n      'Modal or overlay did not appear'\n    );\n  });\n});\n```\n\n## Migration Guide: Protractor to Playwright\n\n```typescript\n\u002F\u002F PROTRACTOR (old)\nimport { browser, element, by, ExpectedConditions as EC } from 'protractor';\n\nawait browser.get('\u002Flogin');\nawait element(by.css('[data-testid=\"username\"]')).sendKeys('user@test.com');\nawait element(by.css('[data-testid=\"password\"]')).sendKeys('pass123');\nawait element(by.css('[data-testid=\"submit\"]')).click();\nawait browser.wait(EC.urlContains('\u002Fdashboard'), 10000);\n\n\u002F\u002F PLAYWRIGHT (new)\nimport { test, expect } from '@playwright\u002Ftest';\n\nawait page.goto('\u002Flogin');\nawait page.locator('[data-testid=\"username\"]').fill('user@test.com');\nawait page.locator('[data-testid=\"password\"]').fill('pass123');\nawait page.locator('[data-testid=\"submit\"]').click();\nawait expect(page).toHaveURL(\u002F.*dashboard\u002F);\n```\n\n```typescript\n\u002F\u002F PROTRACTOR page object\nexport class LoginPageProtractor {\n  usernameInput = element(by.css('[data-testid=\"username\"]'));\n  async login(user: string, pass: string) {\n    await this.usernameInput.sendKeys(user);\n    await element(by.css('[data-testid=\"password\"]')).sendKeys(pass);\n    await element(by.css('[data-testid=\"submit\"]')).click();\n  }\n}\n\n\u002F\u002F PLAYWRIGHT page object\nexport class LoginPagePlaywright {\n  constructor(private page: Page) {}\n  async login(user: string, pass: string) {\n    await this.page.locator('[data-testid=\"username\"]').fill(user);\n    await this.page.locator('[data-testid=\"password\"]').fill(pass);\n    await this.page.locator('[data-testid=\"submit\"]').click();\n  }\n}\n```\n\n## Best Practices\n\n1. **Use async\u002Fawait everywhere** -- Protractor's implicit promise management (control flow) is deprecated. Write all tests with explicit `async\u002Fawait` for clarity and future migration compatibility.\n2. **Prefer `data-testid` selectors** over Angular-specific locators (`by.model`, `by.binding`) for new tests. These translate directly to modern frameworks during migration.\n3. **Use `ExpectedConditions`** for explicit waits rather than `browser.sleep()`. Combine conditions with `EC.and()` and `EC.or()` for complex wait scenarios.\n4. **Implement the Page Object pattern** for every page and reusable component. This isolates locator changes and makes migration to other frameworks straightforward.\n5. **Capture screenshots on failure** using Jasmine reporter hooks. Visual evidence of failures dramatically speeds up debugging.\n6. **Run headless in CI** by configuring `chromeOptions.args` with `--headless`. This reduces resource usage and speeds up pipeline execution.\n7. **Disable Angular sync for non-Angular pages** with `browser.waitForAngularEnabled(false)`. Forgetting this causes infinite waits on non-Angular content.\n8. **Set appropriate timeouts** -- `allScriptsTimeout` for page loads, `defaultTimeoutInterval` for individual tests, and specific timeouts for `browser.wait()` calls.\n9. **Plan your migration strategy** -- Map Protractor APIs to their Playwright\u002FCypress equivalents. Migrate one spec file at a time, running both frameworks in parallel during transition.\n10. **Use `directConnect: true`** to bypass Selenium Server and connect directly to ChromeDriver. This is faster and simpler for single-browser local testing.\n\n## Anti-Patterns\n\n1. **Using `browser.sleep()`** -- Static waits slow tests and hide timing issues. Use `browser.wait()` with `ExpectedConditions` for reliable synchronization.\n2. **Relying on control flow promises** -- The implicit promise chain is deprecated and behaves unpredictably. Use `async\u002Fawait` consistently.\n3. **Not disabling Angular sync for non-Angular pages** -- Protractor hangs indefinitely waiting for Angular on pages that do not use Angular.\n4. **Hardcoding test data** -- Embedding credentials, URLs, and IDs directly in specs makes tests environment-dependent and hard to maintain.\n5. **Using `by.xpath()` for simple queries** -- XPath is slower and harder to read than CSS selectors. Only use XPath when CSS cannot express the query.\n6. **Writing tests that depend on other tests** -- Tests that require prior tests to run create fragile, non-parallelizable suites.\n7. **Ignoring deprecation warnings** -- Protractor is end-of-life. Continuing to build large new test suites on it accumulates technical debt.\n8. **Not using Page Objects** -- Putting locators directly in test files leads to duplication and makes selector changes expensive.\n9. **Forgetting to handle stale elements** -- After page transitions or dynamic updates, element references may become stale. Re-query elements after state changes.\n10. **Running tests sequentially in CI** -- Not configuring parallel execution wastes pipeline time. Use `shardTestFiles: true` with `maxInstances` for parallelism.\n\n## CLI Reference\n\n```bash\n# Run all tests\nnpx protractor protractor.conf.js\n\n# Run specific spec\nnpx protractor protractor.conf.js --specs=e2e\u002Fspecs\u002Fauth\u002Flogin.spec.ts\n\n# Run with specific base URL\nnpx protractor protractor.conf.js --baseUrl=http:\u002F\u002Fstaging.example.com\n\n# Update WebDriver binaries\nnpx webdriver-manager update\n\n# Start Selenium Server (if not using directConnect)\nnpx webdriver-manager start\n\n# Run with verbose logging\nnpx protractor protractor.conf.js --troubleshoot\n```\n\n## Setup\n\n```bash\n# Install Protractor\nnpm install --save-dev protractor\n\n# Install TypeScript support\nnpm install --save-dev typescript ts-node @types\u002Fjasmine @types\u002Fjasminewd2\n\n# Install reporter\nnpm install --save-dev jasmine-spec-reporter\n\n# Update browser drivers\nnpx webdriver-manager update\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],"protractor","angular","angularjs","e2e","selenium","browser-testing","migration",[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",[25],[28,52],"integration","main","eac438ea9216a7cb8a570cab803eb01eeafc6793","skills\u002Fqa\u002Fprotractor-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":62,"prompt":72,"zipAvailable":73},[63,66,69],{"tool":64,"command":65},"npx","npx skills add GrupoANDevelopment-m\u002Falberto-ai --skill \"Protractor Testing\"",{"tool":67,"command":68},"bunx","bunx skills add GrupoANDevelopment-m\u002Falberto-ai --skill \"Protractor Testing\"",{"tool":70,"command":71},"pnpm","pnpm dlx skills add GrupoANDevelopment-m\u002Falberto-ai --skill \"Protractor Testing\"","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FGrupoANDevelopment-m\u002Falberto-ai\u002Fblob\u002Fmain\u002Fskills\u002Fqa\u002Fprotractor-testing\u002FSKILL.md",true,[],[76,84,91,98,105,112],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":80,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"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":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":80,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"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":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":80,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"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":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":80,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"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":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":80,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"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":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":80,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":118,"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",[],[]]