mcpField
N
nemojs-skill

nemojs-skill

github.com/lambdatestテスト・品質384203 回インストール2 週間前に更新
リポジトリ

nemojs-skill について

nemojs-skillは、PayPalのSeleniumベースのNode.js自動化フレームワークNemo.jsを使うためのリファレンススキルです。Mochaテスト、要素検索、設定、TestMu AIでのクラウド実行を扱います。

主な機能

  1. 01Mochaベースのテストパターン
  2. 02CSSとXPathによる要素検索
  3. 03表示待機と複数要素の検索
  4. 04nemo.config.jsonの設定
  5. 05TestMu AIでのクラウド実行ガイド
  6. 06セットアップとテスト実行コマンド

活用シーン

  1. 01MochaとNemo.jsによるブラウザテストの作成
  2. 02ページ要素の検索と表示待機
  3. 03ローカルWebDriverエンドポイントの設定
  4. 04TestMu AIでのクラウド実行設定

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/lambdatest/agent-skills --skill nemojs-skill

インストール後、Claude Code で/nemojs-skillを入力して読み込まれたか確認します。

同梱ファイル

SKILL.md と一緒にインストールされる参考資料やスクリプト。

reference/
advanced-patterns.md
cloud-integration.md
playbook.md

詳細

Nemo.js 自動化スキル

Node.js 向けの、PayPal の Selenium ベースのテスト自動化フレームワークです。

TestMu AI クラウドでの実行については、reference/cloud-integration.md と shared/testmu-cloud-reference.md を参照してください。

基本パターン

基本的なテスト(Mocha)
const Nemo = require('nemo');
const { expect } = require('chai');

describe('Login Flow', function() {
  this.timeout(30000);
  let nemo;

  before(async () => {
    nemo = await Nemo();
  });

  after(async () => {
    await nemo.driver.quit();
  });

  it('should login with valid credentials', async () => {
    await nemo.driver.get(nemo.data.baseUrl + '/login');
    const email = await nemo.view._find('#email');
    await email.sendKeys('[email protected]');
    const password = await nemo.view._find('#password');
    await password.sendKeys('password123');
    await nemo.view._find('button[type="submit"]').click();

    await nemo.view._waitVisible('.dashboard', 10000);
    const url = await nemo.driver.getCurrentUrl();
    expect(url).to.include('/dashboard');
  });

  it('should show error for invalid credentials', async () => {
    await nemo.driver.get(nemo.data.baseUrl + '/login');
    await nemo.view._find('#email').sendKeys('[email protected]');
    await nemo.view._find('#password').sendKeys('wrong');
    await nemo.view._find('button[type="submit"]').click();

    await nemo.view._waitVisible('.error', 5000);
    const error = await nemo.view._find('.error');
    const text = await error.getText();
    expect(text).to.include('Invalid');
  });
});
ビューロケーター
await nemo.view._find('#css-id');                    // CSS
await nemo.view._find('.class-name');                // CSS class
await nemo.view._find('[data-testid="login"]');     // Data attribute
await nemo.view._find('xpath://button[@type]');     // XPath prefix
await nemo.view._waitVisible(locator, timeout);     // Wait + find
await nemo.view._finds('.items');                    // Find multiple
設定(nemo.config.json)
{
  "driver": {
    "browser": "chrome",
    "server": "http://localhost:4444/wd/hub"
  },
  "data": {
    "baseUrl": "http://localhost:3000"
  },
  "view": ["locator"],
  "plugins": {
    "view": { "module": "nemo-view" }
  }
}
TestMu AI でのクラウド実行

環境変数を設定します:LT_USERNAME、LT_ACCESS_KEY

{
  "driver": {
    "browser": "chrome",
    "server": "https://hub.lambdatest.com/wd/hub",
    "serverCaps": {
      "username": "${LT_USERNAME}",
      "accessKey": "${LT_ACCESS_KEY}"
    },
    "capabilities": {
      "LT:Options": {
        "user": "${LT_USERNAME}",
        "accessKey": "${LT_ACCESS_KEY}",
        "build": "Nemo Build",
        "name": "Nemo Test",
        "platformName": "Windows 11",
        "video": true,
        "console": true,
        "network": true
      }
    }
  }
}

セットアップ:npm install nemo nemo-view --save-dev

実行:npx mocha test/*.js --timeout 30000

詳細なパターン

高度なパターン、デバッグガイド、CI/CD 統合、ベストプラクティスについては、 reference/playbook.md を参照してください。

コメント