本文整理匯總了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'))));
}