本文整理匯總了TypeScript中protractor.browser.driver.manage方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript browser.driver.manage方法的具體用法?TypeScript browser.driver.manage怎麽用?TypeScript browser.driver.manage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類protractor.browser.driver
的用法示例。
在下文中一共展示了browser.driver.manage方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: beforeAll
beforeAll(() => {
if (environment === "localDebug") {
password = "Pa$$w0rd";
baseUrl = "http://localhost:8080/";
} else {
password = realPassword;
baseUrl = "http://ca-london.org/";
if (environment !== "production") {
baseHref = environment;
}
for (const username in usernames) {
usernames[username] = "it@ca-london.org";
}
}
browser.driver.manage().deleteAllCookies();
browser.driver.manage().window().maximize();
browser.get(`${baseUrl}${baseHref}`);
});
示例2: setBrowserMode
export async function setBrowserMode(mode: BrowserMode) {
let window = browser.driver.manage().window();
switch (mode) {
case BrowserMode.Phone:
await window.setSize(430, 667);
break;
case BrowserMode.Tablet:
await window.setSize(768, 1024);
break;
case BrowserMode.Desktop:
await window.setSize(1920, 1080);
break;
default:
throw Error('Unknown mode');
}
}
示例3: beforeAll
beforeAll(function () {
browser.driver.manage().deleteAllCookies();
browser.wait(() => tribeCollection.drop()
.then(() => tribeCollection.insert([
{
id: 'e2e1',
name: 'E2E Example Tribe 1'
}, {
id: 'e2e2',
name: 'E2E Example Tribe 2'
}
]))
.then(() => authorizeAllTribes())
.then(() => tribeCollection.find({}, {}))
.then(tribesInCollection => {
tribeDocuments = tribesInCollection;
return true;
}));
browser.get(hostName + '/test-login?username=' + userEmail + '&password="pw"');
});
示例4:
onPrepare: () => {
browser.driver.manage().window().maximize();
},
示例5: expect
checkLeftPanelMini: () => {
browser.driver.manage().window().setSize(800, 600);
browser.sleep(500);
expect(menuLeftMini.isDisplayed()).toBeTruthy();
},
示例6: beforeEach
beforeEach(async() => {
await browser.get('http://localhost:4200')
let width = 1280;
let height = 900;
await browser.driver.manage().window().setSize(width, height);
});