Skip to content

Instantly share code, notes, and snippets.

@henryruhs
Last active January 30, 2020 12:19
Show Gist options
  • Save henryruhs/b7edf72d70d76dc5b1924935e128fbaa to your computer and use it in GitHub Desktop.
Save henryruhs/b7edf72d70d76dc5b1924935e128fbaa to your computer and use it in GitHub Desktop.
import { environmentHelper } from '../../../src/environments/environment';
const environment = environmentHelper(Cypress.env('APP_ENV'));
Cypress.Commands.add('pingApiUrl', () =>
{
cy.request('HEAD', environment.apiUrl);
});
Cypress.Commands.add('insertTestData', () =>
{
const url = new URL(environment.routes.test.insertData, environment.apiUrl);
cy.request('POST', url.toString());
});
Cypress.Commands.add('deleteTestData', () =>
{
const url = new URL(environment.routes.test.deleteData, environment.apiUrl);
cy.request('DELETE', url.toString());
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment