setup.ts 806 B

1234567891011121314151617181920212223242526
  1. export const NETWORK_URL = 'http://*';
  2. export function loginSetup() {
  3. cy.visit('/');
  4. cy.get('input[name="accountName"]').type('admin');
  5. cy.get('input[name="accountPassword"]').type('tld123');
  6. cy.getTestId('login_form').submit();
  7. }
  8. export function loginIntercept() {
  9. cy.intercept(`${NETWORK_URL}/user/login*`, {fixture: 'login'}).as('loginIntercept');
  10. }
  11. export function menuIntercept() {
  12. cy.intercept(`${NETWORK_URL}/menu/getUserMenu*`, {fixture: 'menu/basic'})
  13. .as('menuIntercept');
  14. }
  15. export function optionsIntercept() {
  16. cy.intercept(`${NETWORK_URL}/role/roleBefore*`, {fixture: 'role/options'});
  17. cy.intercept(`${NETWORK_URL}/department/getDepartBefor*`, {fixture: 'department/options'});
  18. cy.intercept(`${NETWORK_URL}/storage/getStorageAll*`, {fixture: 'storage/options'});
  19. }