tmegos blog

Web developer

QA Wolf

github.com

作業ログです

Playwrightのコードを自動生成してくれる
つまりPlaywrightがわかっていれば、QA Wolfで自動生成したコードを取り扱える
前触ったときは、セレクタjsonが出力されていたけど、その時より洗練されてる感じ(xpathがすごいことになっていたような記憶)

www.qawolf.com

$ yarn qawolf -h
Usage: qawolf <command> [options]

Options:
  -V, --version                  output the version number
  -h, --help                     display help for command

Commands:
  create [options] [url] [name]  ✨ create a test from browser actions
  edit [options] [name]          📝 edit a test
  howl                           🐺
  test [options]                 ✅ run tests
✨  Done in 0.52s.

howlとは 🤔

$ yarn qawolf howl
yarn run v1.22.4

                     .
                    / V\
                  / '  /
                 <<   |
                 /    |
               /      |
             /        |
           /    \  \ /
          (      ) | |
  ________|   _/_  | |
<__________\______)\__)

✨  Done in 0.52s.

Playwrightで自動生成したコードよりセレクタがきれい

qawolf hogeしたときに毎回npxでjestがインストールされていたので、依存関係にjestを追加した
(playwrightも必要だった) 毎回以下のようになっていた

$ yarn qawolf test test
yarn run v1.22.4
Test: chromium
npx jest --config="node_modules/qawolf/js-jest.config.json" --rootDir=.qawolf --testTimeout=60000 test

npx: 512個のパッケージを15.348秒でインストールしました。

assertElementTextが雑にセレクタ指定してもちゃんと拾ってくれる

解決してない

依存関係にplaywrightが無いと、
browser.close()TypeError: Cannot read property 'close' of undefinedが出る?

https://github.com/megos/spa-e2e-sandbox/runs/1676936847?check_suite_focus=true