Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 
 

31 wiersze
1.0 KiB

  1. import doctype_with_tab_break from '../fixtures/doctype_with_tab_break';
  2. const doctype_name = doctype_with_tab_break.name;
  3. context("Form Tab Break", () => {
  4. before(() => {
  5. cy.login();
  6. cy.visit('/app/website');
  7. return cy.insert_doc('DocType', doctype_with_tab_break, true);
  8. });
  9. it("Should switch tab and open correct tabs on validation error", () => {
  10. cy.new_form(doctype_name);
  11. // test tab switch
  12. cy.findByRole("tab", {name: "Tab 2"}).click();
  13. cy.findByText("Phone");
  14. cy.findByRole("tab", {name: "Details"}).click();
  15. cy.findByText("Name");
  16. // form should switch to the tab with un-filled mandatory field
  17. cy.fill_field("username", "Test");
  18. cy.findByRole("button", {name: "Save"}).click();
  19. cy.findByText("Missing Fields");
  20. cy.hide_dialog();
  21. cy.findByText("Phone");
  22. cy.fill_field("phone", "12345678");
  23. cy.findByRole("button", {name: "Save"}).click();
  24. // After save, first tab should have dashboard
  25. cy.get(".form-tabs > .nav-item").eq(0).click();
  26. cy.findByText("Connections");
  27. });
  28. });