Cucumber フィーチャー ファイルの並列実行
問題: それぞれが異なるタグに関連付けられている複数の Cucumber フィーチャー ファイルを並列で実行する必要があります。特定のファイルを特定のブラウザに割り当てます。
解決策:
オープンソースの cucumber-jvm-Parallel-plugin を利用すると、次の機能が提供されます。キュウリ テストの並列実行のための豊富なソリューション。
- プラグイン構成:
次のプラグイン構成をプロジェクトの Maven pom ファイルに追加します:
<code class="xml"><dependency> <groupid>com.github.temyers</groupid> <artifactid>cucumber-jvm-parallel-plugin</artifactid> <version>2.1.0</version> </dependency> <plugin> <groupid>com.github.temyers</groupid> <artifactid>cucumber-jvm-parallel-plugin</artifactid> <version>2.1.0</version> <executions> <execution> <id>generateRunners</id> <phase>generate-test-sources</phase> <goals> <goal>generateRunners</goal> </goals> <configuration> <glue>foo, bar</glue> <outputdirectory>${project.build.directory}/generated-test-sources/cucumber</outputdirectory> <featuresdirectory>src/test/resources/features/</featuresdirectory> <cucumberoutputdir>target/cucumber-parallel</cucumberoutputdir> <format>json</format> <strict>truetrue</strict> <tags>@chrome,@firefox</tags> <filterfeaturesbytags>false</filterfeaturesbytags> <usetestng>false</usetestng> <namingscheme>simple</namingscheme> <parallelscheme>SCENARIO</parallelscheme> </configuration> </execution> </executions> </plugin></code>
- 2 番目のプラグインの追加:
前のプラグインによって生成されたランナー クラスを呼び出す別のプラグインを追加します:
<code class="xml"><plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-surefire-plugin</artifactid> <version>2.19</version> <configuration> <forkcount>5</forkcount> <reuseforks>true</reuseforks> <includes> <include>**/*IT.class</include> </includes> </configuration> </plugin></code>
共有 WebDriver クラス:
共有 WebDriver クラスの実装:
<code class="java">public class SharedDriver extends EventFiringWebDriver { // Singleton WebDriver instance private static WebDriver REAL_DRIVER = null; // Closing hook for WebDriver private static final Thread CLOSE_THREAD = new Thread() { @Override public void run() { REAL_DRIVER.close(); } }; // WebDriver setup static { Runtime.getRuntime().addShutdownHook(CLOSE_THREAD); } public SharedDriver() { super(CreateDriver()); } public static WebDriver CreateDriver() { if (REAL_DRIVER == null) REAL_DRIVER = new FirefoxDriver(); setWebDriver(REAL_DRIVER); return REAL_DRIVER; } public static void setWebDriver(WebDriver webDriver) { SharedDriver.REAL_DRIVER = webDriver; } public static WebDriver getWebDriver() { return SharedDriver.REAL_DRIVER; } // Disable closing for shared driver @Override public void close() { if (Thread.currentThread() != CLOSE_THREAD) { throw new UnsupportedOperationException("Closing is handled by shutdown hook."); } super.close(); } }</code>
考慮事項:
- フォーク数 (並列スレッド) の数は、利用可能なハードウェア リソースおよび登録されたノードに合わせて調整する必要があります。
- 多数 (>50) のスレッドを実行するには、グリッド ハブを -DPOOL_MAX=512 以上で開始する必要があります。並行して。
以上がCucumber 機能ファイルを異なるブラウザーやタグで並行して実行するにはどうすればよいですか?の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

jvm'sperformanceiscompetitivewitherruntimes、sped、safety、andproductivityの提供

javaachievesplatformedentenceTheThejavavirtualMachine(JVM)、avainwithcodetorunonanyplatformwithajvm.1)codescompiledintobytecode、notmachine-specificcode.2)

thejvmisanabstractcomputingMachineCrucialForrunningJavaProgramsDuetoitsPlatForm-IndopentInterChitecture.Itincludes:1)ClassLoaderForloadingClasses、2)Runtimedataareaforforforatastorage、3)executionEngineWithinterter、Jitcompiler、およびGarbagecolfecolfecolfececolfecolfer

jvmhasacloserelationshiptheosasittrantesjavabytecodecodecodecodecodecodecodecodecodecodecodecodecodetructions、manageSmemory、およびhandlesgarbagecollection.thisrelationshipallowsjavatorunonvariousosenvirnments、Butalsedentsはspeedifediferentjvmbeviorhiorsandosendisfredediferentjvmbehbehioorysando

Javaの実装「Write and、Run Everywherewhere」はBytecodeにコンパイルされ、Java仮想マシン(JVM)で実行されます。 1)Javaコードを書き、それをByteCodeにコンパイルします。 2)JVMがインストールされたプラットフォームでByteCodeが実行されます。 3)Javaネイティブインターフェイス(JNI)を使用して、プラットフォーム固有の機能を処理します。 JVMの一貫性やプラットフォーム固有のライブラリの使用などの課題にもかかわらず、Woraは開発効率と展開の柔軟性を大幅に向上させます。

javaachievesplatformentenceTheTheTheJavavirtualMachine(JVM)、CodetorunondifferentoperatingSystemswithOutModification.thejvmcompilesjavacodeplatform-IndopentedbyTecodeを承認することを許可します

javaispowerfulfulduetoitsplatformindepentence、object-orientednature、richstandardlibrary、performancecapability、andstrongsecurityfeatures.1)platformendependenceallowseplicationStorunonaydevicesupportingjava.2)オブジェクト指向のプログラマン型

上位のJava関数には、次のものが含まれます。1)オブジェクト指向プログラミング、サポートポリ型、コードの柔軟性と保守性の向上。 2)例外処理メカニズム、トライキャッチ式ブロックによるコードの堅牢性の向上。 3)ゴミ収集、メモリ管理の簡素化。 4)ジェネリック、タイプの安全性の向上。 5)コードをより簡潔で表現力豊かにするためのAMBDAの表現と機能的なプログラミング。 6)最適化されたデータ構造とアルゴリズムを提供するリッチ標準ライブラリ。


ホットAIツール

Undresser.AI Undress
リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover
写真から衣服を削除するオンライン AI ツール。

Undress AI Tool
脱衣画像を無料で

Clothoff.io
AI衣類リムーバー

Video Face Swap
完全無料の AI 顔交換ツールを使用して、あらゆるビデオの顔を簡単に交換できます。

人気の記事

ホットツール

SublimeText3 Mac版
神レベルのコード編集ソフト(SublimeText3)

ゼンドスタジオ 13.0.1
強力な PHP 統合開発環境

Safe Exam Browser
Safe Exam Browser は、オンライン試験を安全に受験するための安全なブラウザ環境です。このソフトウェアは、あらゆるコンピュータを安全なワークステーションに変えます。あらゆるユーティリティへのアクセスを制御し、学生が無許可のリソースを使用するのを防ぎます。

SublimeText3 英語版
推奨: Win バージョン、コードプロンプトをサポート!

PhpStorm Mac バージョン
最新(2018.2.1)のプロフェッショナル向けPHP統合開発ツール
