Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 
 

43 rindas
1.4 KiB

  1. import data_field_validation_doctype from "../fixtures/data_field_validation_doctype";
  2. const doctype_name = data_field_validation_doctype.name;
  3. context("URL Data Field Input", () => {
  4. before(() => {
  5. cy.login();
  6. cy.visit("/app/website");
  7. return cy.insert_doc("DocType", data_field_validation_doctype, true);
  8. });
  9. describe("URL Data Field Input ", () => {
  10. it("should not show URL link button without focus", () => {
  11. cy.new_form(doctype_name);
  12. cy.get_field("url").clear().type("https://xhiveframework.co");
  13. cy.get_field("url").blur().wait(500);
  14. cy.get(".link-btn").should("not.be.visible");
  15. });
  16. it("should show URL link button on focus", () => {
  17. cy.get_field("url").focus().wait(500);
  18. cy.get(".link-btn").should("be.visible");
  19. });
  20. it("should not show URL link button for invalid URL", () => {
  21. cy.get_field("url").clear().type("fuzzbuzz");
  22. cy.get(".link-btn").should("not.be.visible");
  23. });
  24. it("should have valid URL link with target _blank", () => {
  25. cy.get_field("url").clear().type("https://xhiveframework.co");
  26. cy.get(".link-btn .btn-open").should("have.attr", "href", "https://xhiveframework.co");
  27. cy.get(".link-btn .btn-open").should("have.attr", "target", "_blank");
  28. });
  29. it("should inject anchor tag in read-only URL data field", () => {
  30. cy.get('[data-fieldname="read_only_url"]')
  31. .find("a")
  32. .should("have.attr", "target", "_blank");
  33. });
  34. });
  35. });