本文整理汇总了TypeScript中protractor.by.className方法的典型用法代码示例。如果您正苦于以下问题:TypeScript by.className方法的具体用法?TypeScript by.className怎么用?TypeScript by.className使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类protractor.by
的用法示例。
在下文中一共展示了by.className方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it(`should upload a new image successfully`, () => {
element(by.className('upload_link')).click();
expect<any>(element(by.className('upload_button')).getText()).toEqual('Upload');
// Set properties of file to upload
element(by.className('form-control')).sendKeys(tag);
// Change focus
// https://github.com/SeleniumHQ/selenium/wiki/Frequently-Asked-Questions#q-the-onchange-event-doesnt-fire-after-a-call-sendkeys
element(by.xpath('//*[@path="title"]')).click();
// Upload file
element(by.id('fileupload')).sendKeys(path.resolve(process.cwd(), 'e2e', 'cloudinary_logo.png'));
// Wait for upload to complete
expect(element(by.className('status-code')).getText()).toMatch(/Completed with status code 200/i);
browser.controlFlow().execute(function () {
// Add this command to the test's control flow so the value changes only after the previous command completes successfully
deleteByTag = true;
});
// Verify the new image exists in the photo list
element(by.className('back_link')).click();
expect(element(by.xpath(`//h2[text()="${tag}"]`)).isDisplayed()).toBeTruthy();
});
示例2: submitTransaction
static submitTransaction(transaction: string, type: string) {
return OperationsHelper.click(element(by.className('side-button')).all(by.className('button-item')).all(by.className('primary')).first())
.then(() => {
OperationsHelper.click(element(by.className('transaction-modal')).all(by.id('dropdownMenu1')).first());
})
.then(() => {
OperationsHelper.retrieveMatchingElementsByCSS('.transaction-modal', '.dropdown-item', 1)
.then((elements) => {
for (var i = 0; i < elements.length; i++) {
let elm = elements[i];
browser.executeScript(scrollMe, elm);
OperationsHelper.retrieveTextFromElement(elm)
.then((text) => {
if(text.toString() === type) {
return OperationsHelper.click(elm)
}
});
}
});
})
.then(() => {
return browser.executeScript(`
var editor = document.getElementsByClassName('CodeMirror')[0].CodeMirror;
editor.focus();
return editor.setValue('');
`)
})
.then(() => {
return element(by.css('.CodeMirror textarea')).sendKeys(transaction)
})
.then(() => {
return OperationsHelper.click(element(by.id('submitTransactionButton')));
})
}
示例3: it
it('Displays Client detail', () => {
const clientPage = manageGroupPage.clientPanelsById(Constants.defaultClientId);
expect(clientPage.element(by.className('client-name')).getText()).toEqual('Mvc App Live');
expect(clientPage.element(by.className('client-id')).getText()).toEqual('Id: ' + Constants.defaultClientId);
expect(clientPage.element(by.className('client-enviroment')).getText()).toEqual('Live');
expect(clientPage.element(by.className('client-description')).getText()).toEqual('Application');
});
示例4: expect
.then((s) => {
createPage.save();
const groupPanel = homepage.groupPanelsById(s);
expect(groupPanel.element(by.className('home-group-id')).getText()).toEqual(s);
expect(groupPanel.element(by.className('home-group-img')).getAttribute('src')).toEqual(Constants.path('/Resource/ClientGroupImages/testimage.JPG'));
expect(groupPanel.element(by.className('home-group-name')).getText()).toEqual(input);
done();
});
示例5: it
it('opens TaskDetailsPage', () => {
element.all(by.className('task-list-item')).then((tasks) => {
tasks[0].click();
browser.driver.sleep(5000); // wait for the animation
expect(element(by.className('toolbar-title')).getText()).toContain('Reflow Lead-Free');
});
});
示例6: it
it('Open all activity groups', () => {
activityPage.get();
element.all(by.className('activity-group-meta')).click();
browser.wait(ExpectedConditions.visibilityOf(
activityPage.activitiesList.get(aIndex)), constants.conditionTimeout);
expect<any>(activityPage.activitiesList.get(aIndex).isDisplayed()).toBe(true);
});
示例7: waitForToast
waitForToast() {
return browser
.wait(until.elementLocated(by.className('ngx-toastr')), 500, 'not found')
.then((el) => {
return browser.wait(until.elementIsVisible(el), 5000, 'not found');
});
}
示例8: it
it('should support AfterView hooks', function () {
let parentEle = element(by.tagName('after-view-parent'));
let buttonEle = parentEle.element(by.tagName('button')); // Reset
let commentEle = parentEle.element(by.className('comment'));
let logEles = parentEle.all(by.css('h4 ~ div'));
let childViewInputEle = parentEle.element(by.css('my-child-view input'));
let logCount: number;
expect(childViewInputEle.getAttribute('value')).toContain('Magneta');
expect(commentEle.isPresent()).toBe(false, 'comment should not be in DOM');
logEles.count().then(function(count: number) {
logCount = count;
return childViewInputEle.sendKeys('-test-');
}).then(function() {
expect(childViewInputEle.getAttribute('value')).toContain('-test-');
expect(commentEle.isPresent()).toBe(true, 'should have comment because >10 chars');
expect(commentEle.getText()).toContain('long name');
return logEles.count();
}).then(function(count: number) {
expect(logCount + 7).toEqual(count, '7 additional log messages should have been added');
logCount = count;
return buttonEle.click();
}).then(function() {
expect(logEles.count()).toBeLessThan(logCount, 'log should shrink after reset');
});
});
示例9: clickYesForConfirmation
clickYesForConfirmation() {
let okButton = element(by.css('.metron-dialog')).element(by.buttonText('OK'));
let maskElement = element(by.className('modal-backdrop'));
waitForElementVisibility(maskElement)
.then(() => okButton.click())
.then(() => waitForElementInVisibility(maskElement));
}
示例10: it
it('timer and parent seconds should match', function () {
let parent = element(by.tagName(parentTag));
let message = parent.element(by.tagName('countdown-timer')).getText();
browser.sleep(10); // give `seconds` a chance to catchup with `message`
let seconds = parent.element(by.className('seconds')).getText();
expect(message).toContain(seconds);
});