本文整理汇总了TypeScript中protractor/globals.by.className方法的典型用法代码示例。如果您正苦于以下问题:TypeScript by.className方法的具体用法?TypeScript by.className怎么用?TypeScript by.className使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类protractor/globals.by
的用法示例。
在下文中一共展示了by.className方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should allow removing courses', () => {
// Check browser url (dashboard)
expect(browser.driver.getCurrentUrl()).toMatch('/courses');
// Get the number of courses present in the dashboard
var courses1 = element.all(by.className('course-title'));
var i = courses1.count;
// Get and click the button to edit the last one of the courses
var lastEditCoursesIcon = element.all(by.className('course-put-icon')).last();
page.waitUntilElementNotVisible('#put-delete-course-modal');
lastEditCoursesIcon.click();
page.waitForAnimation();
// Get and click the checkbox to allow the course's deletion
browser.driver.findElement(by.css('label[for=delete-checkbox]')).then(function(deletionAllow) {
deletionAllow.click();
// Get and click the button to delete the course
browser.driver.findElement(by.css('div.delete-div a.btn-flat')).then(function(deleteButton) {
deleteButton.click().then(function() {
browser.waitForAngular();
// Get the number of courses present in the dashboard
var courses2 = element.all(by.className('course-title'));
var j = courses2.count;
// Should be exactly one course less than before the deletion
expect(Number(j.toString()) === (Number(i.toString()) - 1));
});
});
});
});
示例2: expect
submitEditCourseBtn.click().then(function() {
browser.waitForAngular();
//The last course should have changed its name
var editedCourse = element.all(by.className('course-title')).last();
expect(editedCourse.getText()).toEqual('[EDITED]');
});