mirror of
https://github.com/grafana/grafana.git
synced 2024-11-23 01:16:31 -06:00
export getBaseUrl
This commit is contained in:
parent
5a0dd3cca0
commit
ae7eecea37
@ -1,5 +1,5 @@
|
|||||||
import { e2e } from '../index';
|
import { e2e } from '../index';
|
||||||
import { fromBaseUrl } from '../support/url';
|
import { getBaseUrl } from '../support/url';
|
||||||
|
|
||||||
const DEFAULT_USERNAME = 'admin';
|
const DEFAULT_USERNAME = 'admin';
|
||||||
const DEFAULT_PASSWORD = 'admin';
|
const DEFAULT_PASSWORD = 'admin';
|
||||||
@ -8,7 +8,7 @@ export const login = (username = DEFAULT_USERNAME, password = DEFAULT_PASSWORD,
|
|||||||
if (loginViaApi) {
|
if (loginViaApi) {
|
||||||
cy.request({
|
cy.request({
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: fromBaseUrl('/login'),
|
url: `${getBaseUrl}/login`,
|
||||||
body: {
|
body: {
|
||||||
user: username,
|
user: username,
|
||||||
password,
|
password,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { e2e } from '../index';
|
import { e2e } from '../index';
|
||||||
|
|
||||||
const getBaseUrl = () => e2e.env('BASE_URL') || e2e.config().baseUrl || 'http://localhost:3000';
|
export const getBaseUrl = () => e2e.env('BASE_URL') || e2e.config().baseUrl || 'http://localhost:3000';
|
||||||
|
|
||||||
export const fromBaseUrl = (url = '') => new URL(url, getBaseUrl()).href;
|
export const fromBaseUrl = (url = '') => new URL(url, getBaseUrl()).href;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user