程序问答   发布时间:2022-06-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了赛普拉斯 - Salesforce |在同一测试场景中运行第二次尝试后,我们遇到了一个问题大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决赛普拉斯 - SALEsforce |在同一测试场景中运行第二次尝试后,我们遇到了一个问题?

开发过程中遇到赛普拉斯 - SALEsforce |在同一测试场景中运行第二次尝试后,我们遇到了一个问题的问题如何解决?下面主要结合日常开发的经验,给出你关于赛普拉斯 - SALEsforce |在同一测试场景中运行第二次尝试后,我们遇到了一个问题的解决方法建议,希望对你解决赛普拉斯 - SALEsforce |在同一测试场景中运行第二次尝试后,我们遇到了一个问题有所启发或帮助;

我目前正在 SALEsforce 和 cypress 中运行一些测试,似乎我在 SALEsforce 内部遇到了一个名为“我们遇到了障碍 - 查看以下字段 - 名字”的问题,但名字已被填写已经。只有当我运行相同的测试两次时才会发生这种情况。

赛普拉斯 - Salesforce |在同一测试场景中运行第二次尝试后,我们遇到了一个问题

我目前使用的代码如下:


/// <reference types="cypress" />

co@R_874_10443@t('Test Scenario',() => {

     
    beforeEach(() => {
        // should make these urls,username,and password all configurable in an environment variable
        cy.leadsPage()
    })

    it('Create lead',() => {

        // go to leads page
        cy.get('a[title="New"]').click()
        cy.get('div.modal-container').scrollintoVIEw().should('be.visible').within(($modal) => {
            // SECTION
            cy.get('span.slds-form-element__label').contains('SBA Loan').scrollintoVIEw().should('be.visible')

            // SECTION
            cy.get('button').contains('Next').scrollintoVIEw().should('be.visible').click()
        })

        cy.reload()

        cy.get('div.modal-container').scrollintoVIEw().should('be.visible').within(($modal) => {

            const leadsData = 'cypress/fixtures/leadsData.Json'
            const firstname = 'mockdata'
            const lastname = 'Test-' + makEID(3)

            // Fill-out form
            cy.get('input[name="firstname"]').type(firstname,{ delay: 100 })
            cy.get('input[name="lastname"]').type(lastname,{ delay: 100 })
            cy.get('input[name="Phone"]').type('3866062141',{ delay: 100 })
            cy.get('label.slds-form-element__label').contains('Lead source').should('be.visible')
            cy.get('label.slds-form-element__label').contains('Lead source').parent().find('input[role="comboBox"]').type('Amazon{enter}',{ force: true })

            //Section - Referral information

            cy.get('label.slds-form-element__label').contains('Is There a Referral source / broker').parent().find('input[role="comboBox"]').type('No{enter}',{ force: true })
            cy.get('label.slds-form-element__label').contains('Referral Partner').scrollintoVIEw().parent().find('input[role="comboBox"]').type('Test broker',{ delay: 100 }).type('{downarrow}{enter}',{ delay: 100 })

            // Function to create new and random emails

            function makEID(length) {
                var result = '';
                var characters = '01234567890123456789';
                var charactersLength = characters.length;
                for (var i = 0; i < length; i++) {
                    result += characters.charat(Math.floor(Math.random() * charactersLength));
                }
                return result;
            }
            const email = 'mockdata-' + makEID(4) + "@mailinator.com";

            // Type new email

            cy.get('input[name="Email"]').type(email,{ delay: 100 }).writefile(leadsData,{ firstname,lastname,email })
            cy.get('input[name="Company"]').type("Test Inc",{ delay: 100 })
            cy.get('label.slds-form-element__label').contains('Do They Have a Website?').parent().find('input[role="comboBox"]').type('No{enter}',{ force: true })
            cy.get('input[name="Company_Phone__c"]').type("3956584141",{ delay: 100 })
            cy.wait(1000)

            cy.get('input[name="city"]').type("Provo",{ delay: 100 })
            cy.get('label.slds-form-element__label').contains('State/province').parent().find('input[role="comboBox"]').type('Utah{enter}',{ force: true })
            cy.get('input[name="postalCode"]').type("84601",{ delay: 100 })
            cy.get('label.slds-form-element__label').contains('Is Franchise').parent().find('input[role="comboBox"]').type('No{enter}',{ force: true })
            cy.get('input[name="AnnualRevenue"]').type("350000",{ delay: 100 })
            cy.get('input[name="numberOfemployees"]').type("37",{ delay: 100 })
            cy.get('input[name="Years_in_Business__c"]').type("10",{ delay: 100 })
            cy.get('textarea[name="street"]').type('2715 w 1929 s',{ delay: 100 })
            cy.wait(1000)
            cy.get('input[name="Estimated_Loan_amount__c"]').type('350000',{ delay: 100 })
            cy.get('label.slds-form-element__label').contains('Type').parent().find('input[role="comboBox"]').type('Paycheck Protection Plan{enter}',{ force: true })
            cy.get('label.slds-form-element__label').contains('Use of Proceeds').parent().find('input[role="comboBox"]').type('Working CAPItal{enter}',{ force: true })
        })

        cy.get('div.modal-container').scrollintoVIEw().should('be.visible').within(($modal) => {

            cy.get('button[name="SaveEdit"]').should('be.visible')
            cy.get('button[name="SaveEdit"]').click()

        })


        cy.wait(10000)

        

            // Look and open the pop-up window
            cy.get('button[type="button"]').contains('Convert').should('be.visible')
            cy.get('button[type="button"]').contains('Convert').click()

  

        cy.wait(1000)

        cy.get('div.modal-container').scrollintoVIEw().should('be.visible').within(($modal) => {

        // Click in the button insIDe of the pop-up windows
        cy.get('.slds-button_brand').contains('Convert').should('be.visible')
        cy.get('.slds-button_brand').contains('Convert').click({ force: true })

        })

        cy.wait(10000)

        // Get into the party record

        cy.get('div.modal-container').scrollintoVIEw().should('be.visible').within(($modal) => {

            cy.get('.slds-button_brand').contains('Party').dblclick()

        })

    })
})

老实说,我以为我们可以通过请求更多时间或请求模态来删除此问题,但似乎这样做不正确。

有人知道如何更好地触发计时和输入事件处理程序吗?或其他任何建议?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

大佬总结

以上是大佬教程为你收集整理的赛普拉斯 - Salesforce |在同一测试场景中运行第二次尝试后,我们遇到了一个问题全部内容,希望文章能够帮你解决赛普拉斯 - Salesforce |在同一测试场景中运行第二次尝试后,我们遇到了一个问题所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。