2017-12-27 29 views
0

私が作業しているプロジェクトでは、編集を伴う製品選択プロセスを繰り返す必要があり、製品を削除してから再開します。私の最高の推測では、これはおそらく数百回繰り返されます。分度器の反復E2Eテスト

概略工程は、次のようになります

1. Spec 1 creates the empty room into which products will be placed. 

2. Spec 2 selects the first product category (baths), selects the first 
product in that category - which is placed into the 'empty room'. Next, 
various options are added/removed from the product..for example, taps, 
side-panels etc. Some assertions will take place, then this product 
will be removed (there's a nice simple on button remove.) 

スペック2は、その後、風呂カテゴリ内の次のバスのために繰り返されることになるように風呂、洗面台、シャワー、トイレ通じ...たくさん! 。

フレームワークに格納された別々のデータファイルに基づいて変数のロードを作成し、 'spec2'の変数を呼び出すことはできますか?これを達成するためのより滑らかな方法がありますか?

+0

このデータファイルの場合は、各 'variable'ストアaを持っているあなたの意図であります製品構成ですか?ファイルからデータをリストに読み込んでリストを使用して製品/部屋を設定しますか? – tehbeardedone

+0

各製品は外部スプレッドシートに記載されています。このリストは、製品データベース内の場所を指すURLの形式で表示されます。ここには、「Image of Cooke & Lewis Strand Corner Bath」という例があります。 –

答えて

0

これにはおそらくbrowser.params()を使用できます。分度器の設定にデータを保存するか、外部のparamsファイルを使用して、設定でインポート/インポートするだけで済みます。

jsonオブジェクトに製品構成を保存し、そのオブジェクトをリストに読み込んだ後、リストを反復してそれぞれを設定するだけで済みます。

params: { 
    productConfigurations: [ 
    product: { 
     category: "baths", 
     options: { 
     taps: true, 
     side-panels: false 
     } 
    }, 
    product: { 
     //etc... 
    } 
    ] 
} 

そして、あなたのテストであなただけの配列にし、あなたが行くから値を割り当てることができます...

const productConfigs = browser.params.productConfigurations; 

for(const product in productConfigs) { 
    //do your product setup and assertions in here 
} 
関連する問題