當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript By.css方法代碼示例

本文整理匯總了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);
 });
開發者ID:robertfmurdock,項目名稱:Coupling,代碼行數:7,代碼來源:edit-player.e2e.ts

示例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');
        });

    });
開發者ID:robertfmurdock,項目名稱:Coupling,代碼行數:28,代碼來源:edit-player.e2e.ts

示例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);
 });
開發者ID:BobChao87,項目名稱:angular,代碼行數:12,代碼來源:largeform_perf.spec.ts

示例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);
 }
開發者ID:AlmogShaul,項目名稱:angular,代碼行數:13,代碼來源:largeform_spec.ts

示例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)');
        });
開發者ID:robertfmurdock,項目名稱:Coupling,代碼行數:35,代碼來源:edit-tribe.e2e.ts

示例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');
 });
開發者ID:AnthonyPAlicea,項目名稱:angular,代碼行數:9,代碼來源:app.e2e-spec.ts

示例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);
        });
開發者ID:robertfmurdock,項目名稱:Coupling,代碼行數:13,代碼來源:history.e2e.ts


注:本文中的protractor.By.css方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。