当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript browser.setLocation方法代码示例

本文整理汇总了TypeScript中protractor.browser.setLocation方法的典型用法代码示例。如果您正苦于以下问题:TypeScript browser.setLocation方法的具体用法?TypeScript browser.setLocation怎么用?TypeScript browser.setLocation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在protractor.browser的用法示例。


在下文中一共展示了browser.setLocation方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: it

        it(`should remember badge selection`, async function () {
            await browser.setLocation(`/${tribe.id}/player/${player1._id}`);
            await browser.wait(() => altBadgeRadio.isPresent(), 1000);

            await altBadgeRadio.click();
            await savePlayerButton.click();
            await waitForSaveToComplete(player1.name);
            await browser.setLocation(`/${tribe.id}/player/${player1._id}`);
            expect(altBadgeRadio.getAttribute('checked')).toBe('true');
        });
开发者ID:robertfmurdock,项目名称:Coupling,代码行数:10,代码来源:edit-player.e2e.ts

示例2: 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

示例3: beforeAll

        beforeAll(async function () {
            const pairAssignmentSet1 = new PairAssignmentDocument(new Date().toISOString(), [[
                {
                    name: 'Ollie',
                    _id: monk.id()
                },
                {
                    name: 'Speedy',
                    _id: monk.id()
                }
            ]]);
            const pairAssignmentSet2 = new PairAssignmentDocument(new Date().toISOString(), [[
                {name: 'Arthur', _id: monk.id()},
                {name: 'Garth', _id: monk.id()}
            ]]);

            const apiGuy = await ApiGuy.new();
            await apiGuy.postTribe(tribe);
            await Promise.all([
                e2eHelp.authorizeUserForTribes([tribe.id]),
                apiGuy.postPairAssignmentSet(tribe.id, pairAssignmentSet1),
                apiGuy.postPairAssignmentSet(tribe.id, pairAssignmentSet2)
            ]);

            await browser.waitForAngular();

            await browser.setLocation(`/${tribe.id}/history`);
            await browser.wait(() => element(By.id('history-view')).isPresent(), 2000)
        });
开发者ID:robertfmurdock,项目名称:Coupling,代码行数:29,代码来源:history.e2e.ts

示例4: it

    it('will let you edit an existing player', function () {
        browser.setLocation(`/${tribe.id}/pairAssignments/current/`);

        element.all(By.repeater('player in players'))
            .first().element(By.className("player-card-header"))
            .click();
        expect(browser.getCurrentUrl()).toEqual(`${hostName}/${tribe.id}/player/${player1._id}/`);
    });
开发者ID:robertfmurdock,项目名称:Coupling,代码行数:8,代码来源:pair-assignments.e2e.ts


注:本文中的protractor.browser.setLocation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。