本文整理汇总了TypeScript中protractor.browser.actions方法的典型用法代码示例。如果您正苦于以下问题:TypeScript browser.actions方法的具体用法?TypeScript browser.actions怎么用?TypeScript browser.actions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类protractor.browser
的用法示例。
在下文中一共展示了browser.actions方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should display context menu on right click with proper elements in view mode', () => {
browser.actions().mouseMove(page.graphContainer(), {x: 0, y: 0}).perform();
browser.actions().click(protractor.Button.RIGHT).perform();
expect(page.contextMenu().getCssValue('display')).toEqual('block');
expect(page.visibleContextMenuItems().map(e => e.getAttribute('id')))
.toEqual(['select-all', 'copy', 'cut', 'paste', 'undo', 'redo']);
});
示例2: it
it ('Check tooltip texts: ' + description, () => {
inputDynamicPopupText.clear();
inputDynamicPopupText.sendKeys(data.inputText);
browser.actions()
.mouseMove(tooltipDynamic as any)
.perform();
expect(tooltipElement.getText()).toBe(data.inputText);
browser.actions()
.mouseMove(inputDynamicTooltipText as any)
.perform();
});
示例3: it
it('Append to body.', () => {
browser.actions()
.mouseMove(tooltipEl.buttonDefaultTooltip)
.perform();
expect(tooltipEl.tooltipElement.isPresent()).toBe(true);
browser.actions()
.mouseMove(tooltipEl.buttonAppendedToBody)
.perform();
expect(tooltipEl.tooltipElement.isPresent()).toBe(true);
});
示例4: expect
input.getSize().then((size) => {
browser.actions()
.mouseMove(input, {x: size.width - 5, y: 5})
.click()
.perform();
expect(input.getAttribute('value')).toBe('1');
browser.actions()
.mouseMove(input, {x: size.width - 5, y: size.height - 5})
.click()
.perform();
expect(input.getAttribute('value')).toBe('0');
});
示例5: it
it('Static modal does not close by misclick', () => {
browser.actions()
.mouseMove({ x: 0, y: 0 })
.click()
.perform();
expect(modalWindow.isDisplayed()).toBe(true);
});
示例6: it
it('should login a test user', () => {
const submitButton = getSubmitButton();
browser.wait(until.presenceOf(submitButton), 10000, 'submit button taking too long to appear in the DOM');
let emailInput = element(by.id('username'));
let passwordInput = element(by.id('password'));
browser.wait(until.visibilityOf(emailInput), 10000, 'Email input taking too long to appear in the DOM');
browser.wait(until.visibilityOf(passwordInput), 10000, 'Password input taking too long to appear in the DOM');
emailInput.sendKeys(testDataJson.username);
passwordInput.sendKeys(testDataJson.password);
expect(emailInput.isPresent()).toBe(true, 'email input not present');
expect(passwordInput.isPresent()).toBe(true, 'password input not present');
expect(submitButton.isPresent()).toBe(true, 'login button not present');
browser.actions().mouseMove(submitButton).click().perform()
.then(
() => {
browser.waitForAngular();
browser.driver.sleep(5000); // This is important, otherwise the following fails!
browser.wait(dashboardVisited, 10000, 'Dashboard page taking too long to load');
browser.executeScript('return window.localStorage.getItem("access_token")')
.then(
(token: string) => {
expect(token !== null && token.length > 3).toBe(true, 'no access token set: ' + token);
}
).catch(
() => {
fail('Login failed: no access token');
}
);
}
);
});
示例7: deleteComment
deleteComment() {
let scrollToEle = element.all(by.css('.comment-container')).get(0);
let trashIcon = element.all(by.css('.fa.fa-trash-o')).get(0);
browser.actions().mouseMove(scrollToEle).perform().then(() => waitForElementVisibility(trashIcon))
.then(() => trashIcon.click())
.then(() => waitForElementVisibility(element(by.css('.modal-backdrop'))));
}