Struct playwright::api::playwright::Playwright [−][src]
pub struct Playwright { /* fields omitted */ }
Entry point
Implementations
impl Playwright
[src]
impl Playwright
[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]
Constructs from installed playwright driver
pub fn prepare(&self) -> Result<()>
[src]
Runs $ playwright install
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]
Launcher
pub fn firefox(&self) -> BrowserType
[src]
Launcher
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]
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();
})();
pub fn device(&self, name: &str) -> Option<DeviceDescriptor>
[src]
Auto Trait Implementations
impl RefUnwindSafe for Playwright
impl RefUnwindSafe for Playwright
impl Send for Playwright
impl Send for Playwright
impl Sync for Playwright
impl Sync for Playwright
impl Unpin for Playwright
impl Unpin for Playwright
impl UnwindSafe for Playwright
impl UnwindSafe for Playwright