本文整理汇总了TypeScript中protractor/globals.browser.driver.getCurrentUrl方法的典型用法代码示例。如果您正苦于以下问题:TypeScript browser.driver.getCurrentUrl方法的具体用法?TypeScript browser.driver.getCurrentUrl怎么用?TypeScript browser.driver.getCurrentUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类protractor/globals.browser.driver
的用法示例。
在下文中一共展示了browser.driver.getCurrentUrl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: expect
sessionReady.click().then(function() {
browser.ignoreSynchronization = true;
//browser.waitForAngular();
//page.waitSeconds(2);
// Check browser url (course-details, tab 1)
expect(browser.driver.getCurrentUrl()).toMatch(/\/session\/[0-9]+/);
element(by.css('#fixed-icon')).click().then(function() {
browser.driver.findElement(by.css('input#message')).then(function(inputChat) {
// Fill input field
inputChat.sendKeys(chatMessage).then(function() {
// Ensure field contain what has been entered
expect(inputChat.getAttribute('value')).toEqual(chatMessage);
page.waitUntilElementPresent('div.system-msg');
browser.driver.findElement(by.css('input#send-btn')).then(function(sendBtn) {
sendBtn.click().then(function() {
page.waitUntilElementPresent("div.own-msg span.user-message");
element.all(by.css(".user-message")).getText().then(function(userMessages) {
expect(userMessages.indexOf(chatMessage) >= 0).toBe(true);
element(by.css('#exit-icon')).click().then(function() {
browser.waitForAngular();
page.waitForAnimation();
expect(browser.driver.getCurrentUrl()).toMatch(/\/courses\/[0-9]+\/1/);
});
});
});
});
});
});
});
});
示例2: it
it('should allow editing courses', () => {
// Check browser url (dashboard)
expect(browser.driver.getCurrentUrl()).toMatch('/courses');
// 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('#course-modal');
lastEditCoursesIcon.click();
page.waitUntilElementPresent('#put-delete-course-modal');
// Get field inputs
var courseNameField = browser.driver.findElement(by.id('inputPutCourseName'));
// Fill input field
courseNameField.clear();
courseNameField.sendKeys('[EDITED]');
// Ensure field contains what has been entered
expect(courseNameField.getAttribute('value')).toEqual('[EDITED]');
browser.driver.findElement(by.id('submit-put-course-btn')).then(function(submitEditCourseBtn) {
// Click submit form
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]');
});
});
});