私はアプリケーションのE2Eテストに分度器(Cucumber js)を使用しています。私はそれを使用して否定的なシナリオをテストしようとしている、つまり、ユーザーがオブジェクトを作成するための重複値を入力すると、それは作成されるべきではなく、ユーザーはモーダルボックス(2-3秒後に消える)。しかし、クリックしたときにモーダルボックスの表示をテストしている間、分度器はエラーを投げています。ここで分度器のモーダルポップアップ処理(キュウリjsあり)
Scenario: User sets in a duplicate logical object name
If a user enters a name which is the duplicate of an existing logical object, they should not be able
to create the logical object
When the user clicks on the "New" button
Then the "New Logical Object" panel should be displayed
Given the user enters "Part" in the "Name" field in the form
And the user enters "Part Description" in the "Description" textarea in the form
And the user uploads the "ProjectManagement.png" file
When the user clicks on the "Create" button in the form
Then there should be an error message in the form of a popup
stepdefファイルです:
@Then(/^there should be an error message in the form of a popup$/)
public assertPopUpError() {
return StepDefUtil.executeInIFrame<BladePanelPage>(BladePanelPage, (page: BladePanelPage) => {
page.assertPopUpErrorMessage();
});
}
ページファイル(BladePanelPage.ts)
/**
* Asserts presence of popup message- for a step which fails .
*
*
* @return Promise.
*/
public assertPopUpErrorMessage(): Chai.PromisedAssertion {
let xpathString = '//aw-pop-up-message//div[contains(@class, 'aw-modal-content')]';
return expect(element(by.xpath(xpathString)).isPresent()).to.eventually.equal(true, 'The Element with xpath "' + xpath + '" is not displayed');
}
は、ここに私のコードですAW-ポップアップ・メッセージ
はカスタムAngular2ですコンポーネント。
分度器から来ているエラーメッセージは次のとおりです。
E /ランチャー - 要素は、XPath で "// AW-ポップアップ・メッセージ// divの[含まれています(@class、" AW -modalコンテンツ「)」 表示されない:真
に等しくなるように偽期待Iはhereとhereを示す方法を試みたが、それは動作していません。 protractor.config.jsファイルのアニメーションを無効にすることも機能していないようです。 ご協力いただければ幸いです。答え上記は、私のために働いた