Struct playwright::api::playwright::Playwright [−][src]
pub struct Playwright { /* fields omitted */ }
Expand description
Entry point
Implementations
impl Playwright
[src]
impl Playwright
[src]pub async fn initialize() -> Result<Playwright, Error>
[src]
pub async fn initialize() -> Result<Playwright, Error>
[src]Installs playwright driver to “$CACHE_DIR/.ms-playwright/playwright-rust/driver”
pub async fn with_driver(driver: Driver) -> Result<Playwright, Error>
[src]
pub async fn with_driver(driver: Driver) -> Result<Playwright, Error>
[src]Constructs from installed playwright driver
pub fn install_chromium(&self) -> Result<()>
[src]
pub fn install_chromium(&self) -> Result<()>
[src]Runs $ playwright install chromium
pub fn install_firefox(&self) -> Result<()>
[src]
pub fn install_webkit(&self) -> Result<()>
[src]
pub fn chromium(&self) -> BrowserType
[src]
pub fn chromium(&self) -> BrowserType
[src]Launcher
pub fn firefox(&self) -> BrowserType
[src]
pub fn firefox(&self) -> BrowserType
[src]Launcher
pub fn webkit(&self) -> BrowserType
[src]
pub fn webkit(&self) -> BrowserType
[src]Launcher
pub fn driver(&mut self) -> &mut Driver
[src]
pub fn selectors(&self) -> Selectors
[src]
pub fn devices(&self) -> Vec<DeviceDescriptor>
[src]
pub fn devices(&self) -> Vec<DeviceDescriptor>
[src]Returns a dictionary of devices to be used with [method: Browser.newContext
] or [method: Browser.newPage
].
const { webkit, devices } = require('playwright');
const iPhone = devices['iPhone 6'];
(async () => {
const browser = await webkit.launch();
const context = await browser.newContext({
...iPhone
});
const page = await context.newPage();
await page.goto('http://example.com');
// other actions...
await browser.close();
})();