playwright-fluent
Version:
Fluent API around playwright
28 lines (27 loc) • 944 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
const playwright_fluent_1 = require("../../playwright-fluent");
describe('Playwright Fluent - withGeolocation', () => {
let p;
beforeEach(() => {
p = new playwright_fluent_1.PlaywrightFluent();
});
afterEach(async () => {
await p.close();
});
test('should show location - chromium', async () => {
// Given
const browser = 'chromium';
// When
await p
.withBrowser(browser)
.withOptions({ headless: false })
.withGeolocation({ longitude: 12.492507, latitude: 41.889938 })
.withPermissions('geolocation')
.navigateTo('https://www.openstreetmap.org/')
.click('.control-locate');
// Then
const currentUrl = await p.getCurrentUrl();
expect(currentUrl).toContain('/#map=19/41.88994/12.49251');
});
});
;