.navigate()
Goes to a URL. Waits for the page to finish loading before continuing.
.navigate('https://example.com')
.navigate('https://pt.wikipedia.org')
.navigate('chrome://history')
Internally:
- Sends
Page.navigate via CDP
- Waits 2 seconds for the browser to start the navigation
- Polls
document.readyState until complete or interactive
On heavy SPAs (React, Vue, Next.js), readyState becomes complete before the content renders. Use .waitFor('#some-element') after navigating to wait for something concrete.
.reload()
Reloads the current page and waits for it to finish loading.
.goBack()
Navigates back in browser history. Equivalent to pressing the back button.
If there’s no history to go back to, easybrawto prints a warning and continues without failing.
.goForward()
Navigates forward in browser history.
Patterns
Navigate and wait for specific content
functions openDashboard {
.navigate('https://app.example.com/dashboard')
.waitFor('#dashboard-content') # wait for React to render
.screenshot('dashboard.png')
}
Navigate through a multi-page flow
functions multiStep {
.navigate('https://site.com/step1')
.waitLoad()
.clickButton('Next')
.waitFor('#step2-form')
.insertText('name', 'John')
.clickButton('Next')
.waitForText('Step 3')
.screenshot('step3.png')
}
Use Chrome internal pages
functions openHistory {
.navigate('chrome://history')
.waitLoad()
.screenshot('history.png')
}
functions openSettings {
.navigate('chrome://settings')
.waitLoad()
.screenshot('settings.png')
}
Language aliases
| English | Português | 日本語 |
|---|
.navigate | .navegar / .irPara | .ナビゲート |
.reload | .recarregar | .リロード |
.goBack | .voltarPagina | .戻る |
.goForward | .avancarPagina | .進む |