agentsclimarketplace

Protractor skill

Skill Pyfagorass/bookofspells/skills/lambdatest/protractor-skill

📖 The Book of Spells: a curated, enchanted index of real LLM tooling — and a pipeline that gathers SKILL.md skills from many houses into one searchable shelf.

Install
npx -y skills add Pyfagorass/bookofspells --skill protractor-skill

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Generates Protractor E2E tests for Angular/AngularJS apps in JS/TS. NOTE: Protractor is officially deprecated — recommend Playwright or Cypress. Use when user mentions "Protractor", "element(by.model())", "Angular E2E". Triggers on: "Protractor", "element(by.model)", "Angular E2E test", "protractor.conf".

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

4.3 KB, as published. Nobody here has run it

Protractor Automation Skill (Deprecated)

Protractor reached end-of-life in 2023. Angular team recommends Playwright or Cypress.

For TestMu AI cloud execution, see reference/cloud-integration.md and shared/testmu-cloud-reference.md.

Core Patterns

Basic Test

describe('Login', () => {
  beforeEach(async () => {
    await browser.get('/login');
  });

  it('should login with valid credentials', async () => {
    await element(by.model('email')).sendKeys('[email protected]');
    await element(by.model('password')).sendKeys('password123');
    await element(by.css('button[type="submit"]')).click();
    expect(await browser.getCurrentUrl()).toContain('/dashboard');
    expect(await element(by.css('.welcome')).getText()).toContain('Welcome');
  });

  it('should show error for invalid credentials', async () => {
    await element(by.model('email')).sendKeys('[email protected]');
    await element(by.model('password')).sendKeys('wrong');
    await element(by.css('button[type="submit"]')).click();
    expect(await element(by.css('.error')).isDisplayed()).toBe(true);
  });
});

Angular-Specific Locators

element(by.model('ctrl.email'));                      // ng-model
element(by.binding('ctrl.username'));                  // Angular binding
element(by.exactBinding('ctrl.name'));                // Exact binding
element(by.repeater('item in items'));                // ng-repeat
element.all(by.repeater('item in items')).count();   // Count repeater
element(by.cssContainingText('.item', 'Active'));     // CSS + text
element(by.buttonText('Submit'));                      // Button text
element(by.partialButtonText('Sub'));                  // Partial text

Page Objects

class LoginPage {
  constructor() {
    this.emailInput = element(by.model('email'));
    this.passwordInput = element(by.model('password'));
    this.loginButton = element(by.css('button[type="submit"]'));
    this.errorMessage = element(by.css('.error'));
  }

  async login(email, password) {
    await this.emailInput.sendKeys(email);
    await this.passwordInput.sendKeys(password);
    await this.loginButton.click();
  }
}

// Usage
const loginPage = new LoginPage();
await loginPage.login('[email protected]', 'password123');

protractor.conf.js

exports.config = {
  framework: 'jasmine',
  seleniumAddress: 'http://localhost:4444/wd/hub',
  specs: ['specs/**/*.spec.js'],
  capabilities: { browserName: 'chrome' },
  jasmineNodeOpts: { defaultTimeoutInterval: 30000 },
  onPrepare: () => {
    browser.waitForAngularEnabled(true);
  }
};

Migration Guide

ProtractorPlaywright
element(by.model('x'))page.locator('[ng-model="x"]')
element(by.css('#id'))page.locator('#id')
browser.get(url)page.goto(url)
element.sendKeys(text)locator.fill(text)
browser.sleep(ms)page.waitForTimeout(ms)
browser.waitForAngular()Not needed (auto-wait)

Cloud Execution on TestMu AI

Set environment variables: LT_USERNAME, LT_ACCESS_KEY

// conf.js
exports.config = {
  seleniumAddress: `https://${process.env.LT_USERNAME}:${process.env.LT_ACCESS_KEY}@hub.lambdatest.com/wd/hub`,
  capabilities: {
    browserName: 'chrome',
    'LT:Options': {
      user: process.env.LT_USERNAME,
      accessKey: process.env.LT_ACCESS_KEY,
      build: 'Protractor Build',
      name: 'Protractor Test',
      platformName: 'Windows 11',
      video: true,
      console: true,
      network: true,
    },
  },
};

Run: npx protractor conf.js (deprecated, use Playwright/Cypress instead)

Deep Patterns

For advanced patterns, debugging guides, CI/CD integration, and best practices, see reference/playbook.md.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.