本文整理汇总了TypeScript中protractor.By.css方法的典型用法代码示例。如果您正苦于以下问题:TypeScript By.css方法的具体用法?TypeScript By.css怎么用?TypeScript By.css使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类protractor.By
的用法示例。
在下文中一共展示了By.css方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should not show the badge selector', function () {
browser.setLocation(`/${tribe.id}/player/${player1._id}`);
const defaultBadgeRadio = element(By.css('#default-badge-radio'));
expect(defaultBadgeRadio.isDisplayed()).toEqual(false);
const altBadgeRadio = element(By.css('#alt-badge-radio'));
expect(altBadgeRadio.isDisplayed()).toEqual(false);
});
示例2: describe
describe('when the tribe has call signs enabled', function () {
const adjectiveTextInput = element(By.css('#adjective-input'));
const nounTextInput = element(By.css('#noun-input'));
beforeAll(async function () {
const tribeClone: Tribe = clone(tribe);
tribeClone.callSignsEnabled = true;
await tribeCollection.update({_id: tribe._id}, tribeClone)
});
it(`should allow entry of adjective and noun, and retain them`, async function () {
await browser.setLocation(`/${tribe.id}/player/${player1._id}`);
await browser.wait(() => adjectiveTextInput.isPresent(), 1000);
await adjectiveTextInput.clear();
await adjectiveTextInput.sendKeys('Superior');
await nounTextInput.clear();
await nounTextInput.sendKeys('Spider-Man');
await savePlayerButton.click();
await waitForSaveToComplete(player1.name);
await browser.setLocation(`/${tribe.id}/player/${player1._id}`);
expect(adjectiveTextInput.getAttribute('value')).toBe('Superior');
expect(nounTextInput.getAttribute('value')).toBe('Spider-Man');
});
});
示例3: it
it('should work for ng2', () => {
openBrowser({
url: '/',
params: [{name: 'copies', value: 1}],
ignoreBrowserSynchronization: true,
});
$('#createDom').click();
expect(element.all(By.css('input[name=value0]')).get(0).getAttribute('value'))
.toBe('someValue0');
$('#destroyDom').click();
expect(element.all(By.css('input[name=value0]')).count()).toBe(0);
});
示例4: testLargeformBenchmark
function testLargeformBenchmark(
openConfig: {url: string, ignoreBrowserSynchronization?: boolean}) {
openBrowser({
url: openConfig.url,
params: [{name: 'copies', value: 1}],
ignoreBrowserSynchronization: openConfig.ignoreBrowserSynchronization,
});
$('#createDom').click();
expect(element.all(By.css('input[name=value0]')).get(0).getAttribute('value'))
.toBe('someValue0');
$('#destroyDom').click();
expect(element.all(By.css('input[name=value0]')).count()).toBe(0);
}
示例5: it
it('can save edits to a tribe correctly', async function () {
await browser.get(hostName + '/test-login?username=' + userEmail + '&password="pw"');
await browser.wait(async () => `${hostName}/tribes/` === await browser.getCurrentUrl(), 1000);
const tribeElements = element.all(By.className('tribe-card'));
tribeElements.first().element(By.className("tribe-card-header")).click();
expect(browser.getCurrentUrl()).toEqual(hostName + '/' + tribe.id + '/edit/');
expect(element(By.id('tribe-name')).getAttribute('value')).toEqual(tribe.name);
const expectedNewName = 'Different name';
element(By.id('tribe-name')).clear();
element(By.id('tribe-name')).sendKeys(expectedNewName);
element(By.id('call-sign-checkbox')).click();
element(By.id('badge-checkbox')).click();
const expectedDefaultBadgeName = 'New Default Badge Name';
updateTextBox(By.id('default-badge-name'), expectedDefaultBadgeName);
const expectedAltBadgeName = 'New Alt Badge Name';
updateTextBox(By.id('alt-badge-name'), expectedAltBadgeName);
const differentBadgesOption = element(By.css('#pairing-rule option[label="Prefer Different Badges (Beta)"]'));
differentBadgesOption.click();
element(By.id('save-tribe-button')).click();
await browser.wait(async () => `${hostName}/tribes/` === await browser.getCurrentUrl(), 1000);
await browser.setLocation('/' + tribe.id + '/edit/');
await browser.wait(() => element(By.id('tribe-name')).isPresent(), 2000);
expect(element(By.id('tribe-name')).getAttribute('value')).toEqual(expectedNewName);
expect(element(By.id('call-sign-checkbox')).getAttribute('checked')).toEqual('true');
expect(element(By.id('badge-checkbox')).getAttribute('checked')).toEqual('true');
expect(element(By.id('default-badge-name')).getAttribute('value')).toEqual(expectedDefaultBadgeName);
expect(element(By.id('alt-badge-name')).getAttribute('value')).toEqual(expectedAltBadgeName);
expect(checkedOption.getAttribute('label')).toBe('Prefer Different Badges (Beta)');
});
示例6: it
it('sanitizes innerHTML', () => {
let interpolated = element(By.className('e2e-inner-html-interpolated'));
expect(interpolated.getText())
.toContain('Template <script>alert("0wned")</script> <b>Syntax</b>');
let bound = element(By.className('e2e-inner-html-bound'));
expect(bound.getText()).toContain('Template alert("0wned") Syntax');
let bold = element(By.css('.e2e-inner-html-bound b'));
expect(bold.getText()).toContain('Syntax');
});
示例7: it
it('can be deleted', async function () {
const pairAssignmentSetElements = element.all(by.className('pair-assignments'));
const deleteButton = pairAssignmentSetElements.get(0).element(By.css('.delete-button'));
deleteButton.click();
const alert = await browser.switchTo().alert();
alert.accept();
await browser.wait(async () => await pairAssignmentSetElements.count() === 1, 2000);
expect(pairAssignmentSetElements.count()).toBe(1);
});