Testing 为什么柏树录音要花太多时间?
我正在试着记录我的考试。你可以在下面看到我要记录的整个测试。 我只使用了一次Testing 为什么柏树录音要花太多时间?,testing,timeout,cypress,recording,Testing,Timeout,Cypress,Recording,我正在试着记录我的考试。你可以在下面看到我要记录的整个测试。 我只使用了一次it,因为这是我在测试时不会被踢出会话的唯一方法,我尝试在代码中使用了几次it,但没有成功,在我选择了一个产品(“ZBI Wohnwert”)后,页面将我重定向到登录区域并尝试使用按钮提交以继续下一页 describe('Investment in AIF ZBI Wohnwert 1 Happy Path', function () { before(function () { cy.clea
it
,因为这是我在测试时不会被踢出会话的唯一方法,我尝试在代码中使用了几次it
,但没有成功,在我选择了一个产品(“ZBI Wohnwert”)后,页面将我重定向到登录区域并尝试使用按钮提交以继续下一页
describe('Investment in AIF ZBI Wohnwert 1 Happy Path', function () {
before(function () {
cy.clearLocalStorage();
cy.clearCookies();
});
it('Goes through whole Investment Process', function () {
cy.visit('https://capitalpioneers.de')
cy.contains('Login').click();
cy.get('#email.form-control')
.type(LogConst.TestUserCostumer.usercos);
cy.get('#password.form-control')
.type(LogConst.TestUserCostumer.usercospass);
cy.contains('Anmelden').click();
cy.url()
.should('include', '/investor');
cy.contains('Produkt').click();
cy.url()
.should('include', '/produkte');
cy.contains('ZBI WohnWert1').click();
cy.get('.input-range.js-inv-calc-input-sum-range.js-input-range[type=range]')
.invoke('val', 50000)
.trigger('change');
cy.get('#ga-btn-invest-now-product-detail-zbi-wohnwert1-aif').click();
cy.contains('Fondsprospekt').click();
cy.contains('Wesentlichen Anlegerinformationen').click();
cy.get('#pre_check_inGermany').click({force: true});
cy.get('#pre_check_readDocument1').click({force: true});
cy.get('#pre_check_readDocument2').click({force: true});
//PERSÖNLICHE ANGABEN///
cy.get('form.js-pre-check-form.js-ajax-form').submit().wait(3000);
cy.get('form > .form-group > #user_profile_sex > .radio:nth-child(2) > .required').click();
cy.get('form > .form-group > #user_profile_sex > .radio > #user_profile_sex_1').click({force: true});
cy.get('.form-group > .select2 > .selection > .select2-selection > #select2-user_profile_title-container').click();
cy.get('ul.select2-results__options');
cy.get('li.select2-results__option').first().click();
cy.get('.row > .col-sm-7 > form > .form-group > #user_profile_firstname').click();
cy.get('.row > .col-sm-7 > form > .form-group > #user_profile_firstname').clear().type('Test User Name');
cy.get('.row > .col-sm-7 > form > .form-group > #user_profile_lastname').clear().type('Test User Lastname');
cy.get('.row > .col-sm-7 > form > .form-group > #user_profile_birthname').clear().type('Test Cypress');
cy.get('.select-inline__select > .select2 > .selection > .select2-selection > #select2-user_profile_birthday_day-container').click();
cy.get('input.select2-search__field').type('01');
cy.get('.select-inline__select > .select2 > .selection > .select2-selection > #select2-user_profile_birthday_month-container').click();
cy.get('input.select2-search__field').type('01');
cy.get('.select-inline__select > .select2 > .selection > .select2-selection > #select2-user_profile_birthday_year-container').click();
cy.get('input.select2-search__field').type('1990');
cy.get('#user_profile_birthplace').click().clear().type('Musterstadt');
cy.get('#select2-user_profile_countryOfBirth-container').click();
cy.get('input.select2-search__field').type('Deutschland');
cy.get('li.select2-results__option').click();
cy.get('#user_profile_mobile').click().clear().type('01234569');
//ANSCHRIFT UND WEITERE ANGABEN//
cy.get('#user_profile_street').click().clear().type('Musterstraße');
cy.get('#user_profile_streetNumber').click().clear().type('10000');
cy.get('#user_profile_zipcode').click().clear().type('55555')
cy.get('#user_profile_city').click().clear().type('Musterstadt Aktuell');
cy.get('#select2-user_profile_country-container').click();
cy.get('#select2-user_profile_country-results').contains('Deutschland').click();
cy.get('.form-group > .select2 > .selection > .select2-selection > #select2-user_profile_occupation-container').click()
cy.get('ul.select2-results__options');//.eq('3').click();
cy.get('li.select2-results__option').eq('2').should('contain', 'Angestellter').click();
//BANK DATEN//
cy.get('.row > .col-sm-7 > form > .form-group > #user_profile_iban').click().clear().type(LogConst.TestBankData.UserIBAN);
cy.get('.row > .col-sm-7 > form > .form-group > #user_profile_bic').click().clear().type(LogConst.TestBankData.UserBIC);
cy.get('.row > .col-sm-7 > form > .form-group > #user_profile_bankname').click().clear().type(LogConst.TestBankData.UserBancName);
///PERSONALAUSWEIS ODER REISEPASS
cy.get('form > .form-group > #user_profile_idCardType > .radio:nth-child(1) > .required').click();
cy.get('.row > .col-sm-7 > form > .form-group > #user_profile_idCardNumber').click().clear().type(LogConst.TestUserIdent.IDCardNumber);
cy.get(' #select2-user_profile_idCardValidUntil_day-container').click();
cy.get('input.select2-search__field').type('01');
cy.get('#select2-user_profile_idCardValidUntil_month-container').click();
cy.get('input.select2-search__field').type('01');
cy.get('#select2-user_profile_idCardValidUntil_year-container').click();
cy.get('input.select2-search__field').type('2027');
cy.get('#select2-user_profile_idCardIssueDate_day-container').click();
cy.get('input.select2-search__field').type('02');
cy.get('#select2-user_profile_idCardIssueDate_month-container').click();
cy.get('input.select2-search__field').type('02');
cy.get('#select2-user_profile_idCardIssueDate_year-container').click();
cy.get('input.select2-search__field').type('2016');
cy.get('#user_profile_idCardIssuer').click().clear().type('Stadt der Musterbehörde');
cy.get('#select2-user_profile_nationality-container').click();
cy.get('ul.select2-results__options');
cy.get('li.select2-results__option').first().click();
//STEUERDATEN
cy.get('#user_profile_financialOffice').click().clear().type('Muster Finanzamt');
cy.get('#user_profile_taxId').click().clear().type(LogConst.TestTaxData.UserTaxID);
cy.get('#user_profile_taxNumber').click().clear().type(LogConst.TestTaxData.UserTaxNumber);
cy.get('.button.button.button--yellow.form__submit').click();
//AGM Seite1
//Angaben zu Ihrer Person
cy.get('#select2-user_reasonableness_part1_highestEducation-container').click();
cy.get('ul.select2-results__options');
cy.get('li.select2-results__option').eq('1').should('contain', 'Hochschulabschluss').click();
cy.get('#select2-user_reasonableness_part1_occupationType-container').click();
cy.get('ul.select2-results__options');
cy.get('li.select2-results__option').eq('2').should('contain', 'Kaufmännische(r) Angestellte(r)').click();
cy.get('#select2-user_reasonableness_part1_pastOccupationType-container').click();
cy.get('#select2-user_reasonableness_part1_pastOccupationType-results');
cy.get('li.select2-results__option').eq('4').should('contain', 'sonstige Tätigkeiten').click();
//Ihre Kenntnisse und Erfahrungen
cy.get('#select2-user_reasonableness_part1_experienceInvestingAif-container').click();
cy.get('ul.select2-results__options');
cy.get('li.select2-results__option').eq('2').should('contain', '1 bis 5').click();
cy.get('#select2-user_reasonableness_part1_experiencePropertyValuesAif-container').click();
cy.get('ul.select2-results__options');
cy.get('li.select2-results__option').eq('2').should('contain', '1 - 3 Transaktionen in den letzten 3 Jahren').click();
cy.get('.button.button--yellow.form__submit').click().wait(3000);
cy.get('a.button.button--yellow.form__submit').click();
//GWG Seite
//GWG
cy.get('#user_moneylaundering_confirmation1').click({force:true});
cy.get('#user_moneylaundering_confirmation2').click({force:true});
cy.get('#user_moneylaundering_confirmation3').click({force:true});
//PEP Person
cy.get('#user_moneylaundering_moneyLaunderingPoliticalPerson_0').click({force:true});
// cy.get('.required control-label--text').click({force:true});
cy.get('#user_moneylaundering_moneyLaunderingGermany_0').click({force:true});
// cy.get('.required control-label--text').click({force:true});;
cy.get('#user_moneylaundering_moneyLaunderingAmerican_1').click({force:true});
cy.get('.button.button--yellow.form__submit').click();
cy.get('.input-range.input-range--light.js-inv-calc-input-sum-range.js-input-range[type=range]')
.invoke('val', 50000)
.trigger('change');
cy.get('.button.button--yellow.form__submit').click();
cy.get('#summary_noConsultationConfirmation').click({force:true});
cy.get('#summary_allowInvestmentDataSharing').click({force:true});
cy.get('#summary_readDocumentsConfirmation').click({force:true});
cy.contains('Verkaufsprospekt').click();
cy.contains('Datenschutzerklärung').click();
cy.contains('Wesentliche Anlegerinformationen').click();
cy.contains('Gesetzlichen Pflichtangaben').click();
cy.contains('Allgemeinen Geschäftsbedingungen').click();
cy.contains('Prospektnachtrag Nr. 1 vom 01.12.2016').click();
cy.contains('Prospektnachtrag Nr. 2 vom 01.12.2016').click();
cy.contains('Investitionsinformation').click();
cy.contains('Prospektnachtrag Nr. 3 vom 01.12.2016').click();
// cy.contains('Kaufauftrag ansehen').click();
// cy.get('#ga-btn-preview-contract-zbi-wohnwert1-aif').click();
cy.get('#summary_readDraftContractConfirmation').click({force:true});
cy.get('#summary_signedName').click().clear().type('Test User Name Lastname');
cy.get('#summary_signedCity').click().clear().type('Musterstadt');
cy.get('#ga-btn-buy-now-zbi-wohnwert1-aif').click();
//cy.get('a.button.button--yellow').should('contain', 'Postident').click();
//cy.contains('1. PostIdent Coupon herunterladen').click();
cy.contains('Zum Investment').click();
cy.get('.a.navigation-user.dropdown-toggle').click();
cy.get('ul.dropdown-menu.navigation__dropdown__nav.navigation__nav--mobile.underline-links.underline-links--white');
cy.get('li').eq('7').should('contain', 'Logout');
})
});
我知道这看起来很可怕,但我对测试或JavaScript不熟悉,我想我永远也不会熟悉,但我的学士学位论文需要这个
你知道为什么我要花这么长时间来记录这个测试吗?你们有谁知道如何解决这个问题吗
我不明白,因为我没有收到任何错误消息。我对你的问题感到困惑。当你说录制时,你的意思是实际录制测试运行的视频吗?或者你的意思是运行这个测试需要很长时间?考试需要多长时间?您是通过命令行还是通过UI运行它?关于快速测试运行时间的策略是将测试分成不同的部分。你的代码行越多,测试在中间的某个地方失败的可能性就越高。有没有办法将代码分成单独的it块?这里有两个问题-#1由于登录会话中断,测试步骤被拆分。这已经在您的另一个问题中解决了-#2关于视频录制需要很长时间,您可能需要在
cypress.json中播放videoCompression
-