go(url)
This is a TDK feature
This is not supported in Testim's visual editor
The go
command navigates to a given web page in the controlled browser.
url
{string} a URL to navigate to on the tab- returns:
Promise
which fulfills as soon as the navigation action is executed.
Example usage:
// ✅ navigate to a web page
await go('http://example.org');
// ✅ https is supported
await go('https://example.com');
// ✅ any web page accessible from the browser is fine
await go('http://localhost:8388');
// ❌ does not take an object parameter
await go({url : 'http://example.com' });
// ❌ a valid URL has to be passed
await go('example');
Note: go creates a navigation action in the Testim UI.
Note: If you have multiple tests in the same file they will share the same browser instance
Full test example:
'use strict';
const expect = require('chai').expect;
const { go, click, test, text } = require('testim');
describe('navigation', () => {
test('navigating to a URL', async () => {
await go('http://example.com');
});
});
Updated almost 3 years ago