本文整理汇总了TypeScript中protractor.ExpectedConditions.visibilityOf方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ExpectedConditions.visibilityOf方法的具体用法?TypeScript ExpectedConditions.visibilityOf怎么用?TypeScript ExpectedConditions.visibilityOf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类protractor.ExpectedConditions
的用法示例。
在下文中一共展示了ExpectedConditions.visibilityOf方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('can update an existing template', () => {
projectSettingsPage.templatesTab.list.last().element(by.linkText('sound check')).click();
browser.wait(ExpectedConditions.visibilityOf(projectSettingsPage.templatesTab.editor.saveButton),
Utils.conditionTimeout);
expect<any>(projectSettingsPage.templatesTab.editor.saveButton.isDisplayed()).toBe(true);
projectSettingsPage.templatesTab.editor.title.clear();
projectSettingsPage.templatesTab.editor.title.sendKeys('test12');
projectSettingsPage.templatesTab.editor.saveButton.click();
browser.wait(ExpectedConditions.invisibilityOf(projectSettingsPage.templatesTab.editor.saveButton),
Utils.conditionTimeout);
expect<any>(projectSettingsPage.templatesTab.editor.saveButton.isDisplayed()).toBe(false);
expect<any>(projectSettingsPage.templatesTab.list.count()).toBe(3);
});
示例2: cancelImport
// Cancel import
static cancelImport() {
// Import drawer should be present, button should be visible within chosen-network div
browser.wait(ExpectedConditions.visibilityOf(element(by.css('.chosen-network'))), Constants.longWait);
// Wait for poplation of sample-network-list-item(s)
OperationsHelper.retrieveMatchingElementsByCSS('.sample-network-list-container', '.sample-network-list-item', 3)
.then(() => {
let cancelElement = element(by.id('import_cancel'));
browser.executeScript('arguments[0].scrollIntoView();', cancelElement.getWebElement());
OperationsHelper.click(cancelElement);
browser.wait(ExpectedConditions.invisibilityOf(element(by.css('.drawer'))), Constants.longWait);
});
}
示例3: it
it('can successfully changes user\'s password after form submission', () => {
changePasswordPage.password.sendKeys(newPassword);
changePasswordPage.confirm.sendKeys(newPassword);
browser.wait(ExpectedConditions.visibilityOf(changePasswordPage.passwordMatchImage), constants.conditionTimeout);
browser.wait(ExpectedConditions.elementToBeClickable(changePasswordPage.submitButton), constants.conditionTimeout);
changePasswordPage.submitButton.click();
expect<any>(changePasswordPage.noticeList.count()).toBe(1);
expect(changePasswordPage.noticeList.first().getText()).toContain('Password updated');
BellowsLoginPage.logout();
loginPage.login(constants.memberUsername, newPassword);
browser.wait(ExpectedConditions.visibilityOf(header.myProjects.button), constants.conditionTimeout);
expect<any>(header.myProjects.button.isDisplayed()).toBe(true);
// reset password back to original
changePasswordPage.get();
changePasswordPage.password.sendKeys(constants.memberPassword);
changePasswordPage.confirm.sendKeys(constants.memberPassword);
browser.wait(ExpectedConditions.visibilityOf(changePasswordPage.passwordMatchImage), constants.conditionTimeout);
browser.wait(ExpectedConditions.elementToBeClickable(changePasswordPage.submitButton), constants.conditionTimeout);
changePasswordPage.submitButton.click();
});
示例4: it
it('should login successfully with admin account', async () => {
await browser.get('/');
signInPage = await navBarPage.getSignInPage();
const expect1 = /global.form.username/;
const value1 = await element(by.className('username-label')).getAttribute('jhiTranslate');
expect(value1).toMatch(expect1);
await signInPage.autoSignInUsing('admin', 'admin');
const expect2 = /home.logged.message/;
const value2 = element(by.id('home-logged-message'));
await browser.wait(ec.visibilityOf(value2), 5000);
expect(await value2.getAttribute('jhiTranslate')).toMatch(expect2);
});
示例5: selectBusinessNetworkDefinitionFromFile
// Select BND from BNA file drop
static selectBusinessNetworkDefinitionFromFile(filePath: string) {
// Import modal should be present
return browser.wait(ExpectedConditions.visibilityOf(element(by.css('.import'))), 10000)
.then(() => {
let inputFileElement = element(by.id('file-importer_input'));
return dragDropFile(inputFileElement, filePath);
})
.then(() => {
let importElement = element(by.id('import_confirm'));
return browser.wait(ExpectedConditions.elementToBeClickable(importElement), 10000)
.then(() => {
return importElement.click();
});
});
}
示例6: it
it('cannot request for non-existent user', () => {
BellowsForgotPasswordPage.get();
expect<any>(forgotPasswordPage.infoMessages.count()).toBe(0);
expect<any>(forgotPasswordPage.errors.count()).toBe(0);
forgotPasswordPage.usernameInput.sendKeys(constants.unusedUsername);
forgotPasswordPage.submitButton.click();
browser.wait(ExpectedConditions.visibilityOf(forgotPasswordPage.errors.get(0)), constants.conditionTimeout);
expect<any>(forgotPasswordPage.errors.count()).toBe(1);
expect<any>(forgotPasswordPage.errors.first().getText()).toContain('User not found');
forgotPasswordPage.usernameInput.clear();
// clear errors so that afterEach appFrame error check doesn't fail, see project-settings.e2e-spec.js
browser.refresh();
expect<any>(forgotPasswordPage.errors.count()).toBe(0);
});
示例7: it
it('Login with new username and revert to original username', () => {
// user is automatically logged out and taken to login page when username is changed
browser.wait(ExpectedConditions.visibilityOf(loginPage.username), constants.conditionTimeout);
expect<any>(loginPage.infoMessages.count()).toBe(1);
expect(loginPage.infoMessages.first().getText()).toContain('Username changed. Please login.');
loginPage.login(newUsername, password);
userProfile.getMyAccount();
expect<any>(userProfile.myAccountTab.username.getAttribute('value')).toEqual(newUsername);
userProfile.myAccountTab.updateUsername(expectedUsername);
userProfile.myAccountTab.saveBtn.click();
Utils.clickModalButton('Save changes');
BellowsLoginPage.get();
});
示例8: it
it('create: new empty project', () => {
NewLexProjectPage.get();
page.chooserPage.createButton.click();
page.namePage.projectNameInput.sendKeys(constants.emptyProjectName + Key.TAB);
browser.wait(ExpectedConditions.visibilityOf(page.namePage.projectCodeOk), constants.conditionTimeout);
expect<any>(page.namePage.projectCodeExists.isPresent()).toBe(false);
expect<any>(page.namePage.projectCodeAlphanumeric.isPresent()).toBe(false);
expect<any>(page.namePage.projectCodeOk.isDisplayed()).toBe(true);
expect<any>(page.nextButton.isEnabled()).toBe(true);
// added sleep to ensure state is stable so the next test passes (expectFormIsNotValid)
browser.sleep(500);
page.nextButton.click();
expect<any>(page.namePage.projectNameInput.isPresent()).toBe(false);
expect<any>(page.initialDataPage.browseButton.isPresent()).toBe(true);
});
示例9: it
it('Manager can delete if owner', () => {
if (!browser.baseUrl.startsWith('http://jamaicanpsalms') && !browser.baseUrl.startsWith('https://jamaicanpsalms')) {
loginPage.loginAsManager();
settingsPage.get(constants.fourthProjectName);
expect<any>(settingsPage.noticeList.count()).toBe(0);
settingsPage.tabs.remove.click();
browser.wait(ExpectedConditions.visibilityOf(settingsPage.deleteTab.deleteButton), constants.conditionTimeout);
expect<any>(settingsPage.deleteTab.deleteButton.isDisplayed()).toBe(true);
expect<any>(settingsPage.deleteTab.deleteButton.isEnabled()).toBe(false);
settingsPage.deleteTab.deleteBoxText.sendKeys('DELETE');
expect<any>(settingsPage.deleteTab.deleteButton.isEnabled()).toBe(true);
settingsPage.deleteTab.deleteButton.click();
Utils.clickModalButton('Delete');
projectsPage.get();
expect<any>(projectsPage.projectsList.count()).toBe(3);
}
});
示例10: it
it('should create a third new position on sumbmit', () => {
expect(element(by.id('submit')).isPresent()).toBe(true);
expect(element(by.id('submit')).isEnabled()).toBe(false);
const table = element(by.id('positions'));
expect(table.isPresent()).toBe(true);
const rows = table.$$('tr');
expect(rows.count()).toBe(2);
element(by.css('input[formcontrolname=newName]')).sendKeys('Position 3');
expect(element(by.id('submit')).isEnabled()).toBe(true);
element(by.id('submit')).click();
browser.wait(ExpectedConditions.visibilityOf(element(by.id('name-2'))), 5000) ;
expect(element(by.id('submit')).isEnabled()).toBe(false);
expect(element(by.id('name-2')).getAttribute('value')).toBe('Position 3');
});