0

我正在尝试启动浏览器。它启动浏览器并通过抛出“哎呀,没有要运行的测试”错误来执行后续步骤。有人可以帮忙吗。以下是供参考的代码。

  1. 项目清单
    describe("Salesforce Validation", () => {
      var email_array = [];
      var lastName_array = [];
      var firstName_array = [];
    
    
      it("Saleforce Validation1", () => {
        // cy.wait(2000);
        // cy.task("setHref", emails_array);
        // cy.task("getHref").then((emails_array) => {
            // cy.log(emails_array);
    
          cy.task("setFirstName", firstName_array);
          cy.task("getFirstName").then((firstName_array) => {
            cy.log(firstName_array);
    
    
          cy.task("setLastName", lastName_array);
          cy.task("getLastName").then((lastName_array) => {
            cy.log(lastName_array);
    
          cy.task("setemail", email_array);
          cy.task("getemail").then((email_array) => {
            cy.log(email_array);
    
            // cy.log(emails_array.length);
            // cy.log(emails_array);
            
            cy.request(
              "https://edplus-asu--qa.my.salesforce.com/?un=edplusqa%40edplus.asu.edu.qa&pw=qasalesforce8&startURL=%2F001"
            );
            cy.visit(
              "https://edplus-asu--qa.my.salesforce.com/home/home.jsp?source=lex"
            );
    
            cy.wait(3000);
    
            // cy.get('input[id="Login"]').click({ force: true });
            
            // cy.get('input[id="thePage:inputForm:continue"]').click({ force: true });
            
            // cy.get('button[class="slds-button branding-userProfile-button slds-button slds-global-actions__avatar slds-global-actions__item-action activated forceHeaderButton"]'
            // ).click();
            // https: cy.contains("View profile").click({ force: true });
            // cy.contains("Switch to Salesforce Classic").click({ force: true });
            cy.get('input[id="phSearchInput"]').click();
            cy.get('input[id="phSearchInput"]').type('utm25@qa.in', {
                  force: true,
                  });
            cy.get('input[id="phSearchButton"]').click();
             
            if (
                cy.get(
                  "#Interaction__c_body> table > tbody > tr.dataRow.even.last.first > th > a"
                ) != null
              ) {
                // click interaction
                cy.get(
                  "#Interaction__c_body > table > tbody > tr.dataRow.even.first > th > a"
                ).click();
    
    
              //  Validating fields present in SF
    
                cy.wait(2000);
                cy.get(
                  "#ep > div.pbBody > div:nth-child(2) > table > tbody > tr:nth-child(4) > td.dataCol.col02"
                ).should("have.text", 'embtest');
    
                cy.get(
                  "#ep > div.pbBody > div:nth-child(2) > table > tbody > tr:nth-child(6) > td.dataCol.col02"
                ).should("have.text", 'last');
    
                cy.get(
                  "#ep > div.pbBody > div:nth-child(2) > table > tbody > tr:nth-child(11) > td.dataCol.col02 > a"
                ).should("have.text", 'utm25@qa.in');
              //   cy.get(
              //     "#ep > div.pbBody > div:nth-child(2) > table > tbody > tr:nth-child(8) > td.dataCol.col02"
          //     //     ).should("have.text", 1 + phoneNumber);
          //       }
              }
             
          
            });// end lastName
          });
        });
      });
    });
4

0 回答 0