LoginSignup
0
0

More than 5 years have passed since last update.

Windows環境でProtractor動かしてみる

Posted at

nodeを入れる

入っている方は読み飛ばしてください。

nodeのバージョン管理ソフト「nodist」を入れる

公式サイトからインストーラを取得する。
https://github.com/marcelklehr/nodist#installing-with-the-official-installer

特に問題がなければデフォルトのままインストールする。

参考:
http://qiita.com/yokoh9/items/20d6bdc6030a3a861189

Gitクライアントを入れる

Gitクライアントにパス通っていれば良い。
無ければ入れる。

Git GUIを入れる。
ここからインストーラを取得する。
http://git-scm.com/download/win

設定を二か所、デフォルトから変更する。

  • cmd.exe以外からも使うように設定変更する。
  • checkoutとcommitをas-isで行うように設定変更する。

nodeを入れる

コマンドプロンプトを再起動した後

nodeの初回インストール
nodist update
nodeのバージョン切り替え例(オプション)
nodist 4.2.2
確認
node -v

Protractorを入れる

まずはnode-gypでビルドするための環境を作る
https://github.com/nodejs/node-gyp

Pythonを入れる

2.7系推奨(node-gypが推奨している)。
入っている方は読み飛ばして下さい。
https://www.python.org/downloads/
(今回は最新版として2.7.10で試します。)

インストール後

  • パスを通す。
  • コマンドプロンプトを再起動する。
確認(大文字なので注意)
python -V

visual studio 2013入れる

Visual Studio Express 2013 for Desktopを入れる
https://www.visualstudio.com/ja-jp/downloads/download-visual-studio-vs.aspx

設定ファイルを変更する

ライブラリのインクルードを設定する。
C:\Users\$username\"Local Settings\application Data"\Microsoft\MSBuild\v4.0\

Microsoft.Cpp.x64.user.props
<?xml version="1.0" encoding="utf-8"?> 
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ImportGroup Label="PropertySheets">
  </ImportGroup>
  <PropertyGroup Label="UserMacros" />
  <!--追加と変更ここから-->
  <PropertyGroup>
    <ExecutablePath>$(ExecutablePath)</ExecutablePath>
    <IncludePath>$(IncludePath)</IncludePath>
    <ReferencePath>$(ReferencePath)</ReferencePath>
    <LibraryPAth>$(LibraryPAth)</LibraryPAth>
    <SourcePath>$(SourcePath)</SourcePath>
    <ExcludePath>$(ExcludePath)</ExcludePath>
  </PropertyGroup>
  <!--ここまで-->
  <ItemDefinitionGroup />
  <ItemGroup />
</Project>

Protractorを入れる

インストール
npm install -g protractor
webdriverインストール
webdriver-manager update
確認
webdriver-manager status

参考:
https://angular.github.io/protractor/#/
http://seleniumeasy.com/protractor-angularjs-tutorials/install-protractor

試しにテストを一つ

cd ~\node_modules\protractor\example\
protractor conf.js

Google Chromeが起動してテストを実行する。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0