currentURL()

Returns the current application URL during an acceptance test.

Since Ember 4/5 (Octane) Spec ↗

Syntax

currentURL(): string

Returns

string — The current route URL including query params.

Examples

import { visit, click, currentURL } from '@ember/test-helpers';

test('navigates after submit', async function (assert) {
  await visit('/login');
  await click('[data-test-submit]');
  assert.equal(currentURL(), '/dashboard');
});

Notes

Synchronous and reflects the router's logical URL (including query params), independent of the test container's location. Use after awaited navigation helpers.