问题是当你点击"添加规则"按钮,你得到新的"搜索术语"和"搜索textarea"领域。 但量角器无法看到它们。
it('On "Add new Audience Rule" page should have two rules and two
search Terms', () => {
audiencePage.addRule.click().then(() => {
expect(audiencePage.ORbutton.isPresent()).toBe(true);
expect(audiencePage.searchTerms.count()).toEqual(2);
});
});
错误日志:
1) Audience page: On "Add new Audience Rule" page should have two rules and two search Terms
- Expected false to be true.
- Expected 1 to equal 2.
答案 0 :(得分:1)
当你这样尝试时它会起作用吗?
beforeAll(() => {
audiencePage.addRule.click();
});
it('On "Add new Audience Rule" page should have an OR button', () => {
expect(audiencePage.ORbutton.isDisplayed()).toBe(true);
});
it('On "Add new Audience Rule" page should have two search Terms', () => {
expect(audiencePage.searchTerms.count()).toEqual(2);
});