Latihan Validasi Cypress MBB TD
Untuk mem validasi tampilan error di normor rekeningunknown
plain_text
2 years ago
6.8 kB
2
Indexable
Never
describe("Halaman MBB-TD",()=>{ it("visit Halaman MBB-TD", ()=>{ cy.visit("https://mbb-td-fe.akarinti.tech/fund-transfer/beneficiary?auth=%7B%22corpId%22:%22INTIAKAR%22,%22corporateName%22:%22INTIAKAR%22,%22userId%22:%22VINCENTTYPE3%22,%22userFullName%22:%22VINCENTTYPE3%22,%22role%22:%22MAKER_RELEASER%22,%22sysadminRole%22:null,%22cin%22:null,%22language%22:%22ID%22,%22publicKey%22:%22MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgK%22,%22userType%22:null,%22sysUserId%22:null,%22menuCodes%22:%5B%22TRANSFER_BENEFICIARY%22,%22INQUIRY_TRANSFER_BENEFICIARY%22%5D,%22menuGroups%22:%5B%7B%22code%22:%22TRANSFER%22,%22name%22:%22Transfer%22,%22order%22:2,%22menus%22:%5B%7B%22code%22:%22TRANSFER_BENEFICIARY%22,%22name%22:%22Daftar%20Rekening%20Tujuan%22,%22icon%22:%22transfer_beneficiary.svg%22,%22route%22:%22%2Ffund-transfer%2Fbeneficiary%22,%22order%22:1,%22type%22:%22TNF%22,%22upload%22:%22false%22,%22mobile%22:%22true%22,%22hidden%22:%22false%22%7D,%7B%22code%22:%22INQUIRY_TRANSFER_BENEFICIARY%22,%22name%22:%22Daftar%20Rekening%20Tujuan%22,%22icon%22:%22transfer_beneficiary.svg%22,%22route%22:%22%2Ffund-transfer%2Fbeneficiary%22,%22order%22:1,%22type%22:%22TNF%22,%22upload%22:%22false%22,%22mobile%22:%22true%22,%22hidden%22:%22true%22%7D%5D%7D%5D,%22scopes%22:%5B%22EXECUTE%22%5D,%22menu%22:%5B%7B%22code%22:%22TRANSFER%22,%22name%22:%22Transfer%22,%22order%22:2,%22menus%22:%5B%7B%22code%22:%22TRANSFER_BENEFICIARY%22,%22name%22:%22Daftar%20Rekening%20Tujuan%22,%22icon%22:%22transfer_beneficiary.svg%22,%22route%22:%22%2Ffund-transfer%2Fbeneficiary%22,%22order%22:1,%22type%22:%22TNF%22,%22upload%22:%22false%22,%22mobile%22:%22true%22,%22hidden%22:%22false%22%7D,%7B%22code%22:%22INQUIRY_TRANSFER_BENEFICIARY%22,%22name%22:%22Daftar%20Rekening%20Tujuan%22,%22icon%22:%22transfer_beneficiary.svg%22,%22route%22:%22%2Ffund-transfer%2Fbeneficiary%22,%22order%22:1,%22type%22:%22TNF%22,%22upload%22:%22false%22,%22mobile%22:%22true%22,%22hidden%22:%22true%22%7D%5D%7D%5D,%22workflow%22:true%7D"); cy.title().should ("eq", "myBCA Bisnis"); cy.contains("Daftar Rekening Tujuan"); cy.contains("Tampilkan").click(); cy.contains("Tambah Rekening").click(); } ); it("Add Rek BCA", ()=>{ cy.visit("https://mbb-td-fe.akarinti.tech/fund-transfer/beneficiary/add-bca?auth=%7B%22corpId%22:%22INTIAKAR%22,%22corporateName%22:%22INTIAKAR%22,%22userId%22:%22VINCENTTYPE3%22,%22userFullName%22:%22VINCENTTYPE3%22,%22role%22:%22MAKER_RELEASER%22,%22sysadminRole%22:null,%22cin%22:null,%22language%22:%22ID%22,%22publicKey%22:%22MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgK%22,%22userType%22:null,%22sysUserId%22:null,%22menuCodes%22:%5B%22TRANSFER_BENEFICIARY%22,%22INQUIRY_TRANSFER_BENEFICIARY%22%5D,%22menuGroups%22:%5B%7B%22code%22:%22TRANSFER%22,%22name%22:%22Transfer%22,%22order%22:2,%22menus%22:%5B%7B%22code%22:%22TRANSFER_BENEFICIARY%22,%22name%22:%22Daftar%20Rekening%20Tujuan%22,%22icon%22:%22transfer_beneficiary.svg%22,%22route%22:%22%2Ffund-transfer%2Fbeneficiary%22,%22order%22:1,%22type%22:%22TNF%22,%22upload%22:%22false%22,%22mobile%22:%22true%22,%22hidden%22:%22false%22%7D,%7B%22code%22:%22INQUIRY_TRANSFER_BENEFICIARY%22,%22name%22:%22Daftar%20Rekening%20Tujuan%22,%22icon%22:%22transfer_beneficiary.svg%22,%22route%22:%22%2Ffund-transfer%2Fbeneficiary%22,%22order%22:1,%22type%22:%22TNF%22,%22upload%22:%22false%22,%22mobile%22:%22true%22,%22hidden%22:%22true%22%7D%5D%7D%5D,%22scopes%22:%5B%22EXECUTE%22%5D,%22menu%22:%5B%7B%22code%22:%22TRANSFER%22,%22name%22:%22Transfer%22,%22order%22:2,%22menus%22:%5B%7B%22code%22:%22TRANSFER_BENEFICIARY%22,%22name%22:%22Daftar%20Rekening%20Tujuan%22,%22icon%22:%22transfer_beneficiary.svg%22,%22route%22:%22%2Ffund-transfer%2Fbeneficiary%22,%22order%22:1,%22type%22:%22TNF%22,%22upload%22:%22false%22,%22mobile%22:%22true%22,%22hidden%22:%22false%22%7D,%7B%22code%22:%22INQUIRY_TRANSFER_BENEFICIARY%22,%22name%22:%22Daftar%20Rekening%20Tujuan%22,%22icon%22:%22transfer_beneficiary.svg%22,%22route%22:%22%2Ffund-transfer%2Fbeneficiary%22,%22order%22:1,%22type%22:%22TNF%22,%22upload%22:%22false%22,%22mobile%22:%22true%22,%22hidden%22:%22true%22%7D%5D%7D%5D,%22workflow%22:true%7D"); const BeneficiaryID = cy.get('#mat-input-2').click(); BeneficiaryID.type("Testing Cyp"); const NoRek = cy.get('#mat-input-0').click(); NoRek.type("1111111123") const button = cy.get('#btn-add-bca > .button-large'); button.click(); }); it("Validasi error", ()=>{ it('Validates POST Response', () => { cy.request({ method: 'POST', url: 'https://mbb-td.akarinti.tech/workflow/account-destination/validate/bca', headers: { 'USER-DETAILS': JSON.stringify({ "isNeedVpn": "false", "role": "MAKER_RELEASER", "corpId": "AKARINTI", "userFullName": "USERC", "language": "ID", "publicKey": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnqKBN4iUIMH4SnAxRTqumQ+NI3AALT8KkPymWgDp2qMQWlf1oOk4Eakn/BHut/iV0XGcm8Xnt7Lh5nvKKM0seTN43HLpbZ5EtnPcSfYfUGJCSuvnrgX1DdprctYdi+uMs9oRmI2/jJrQzROL+otonz+k4/VD55sIY2Uftk8fSOR+RRsxAv+yaYW/LqFhi65i/hjA/Mbgz0p3E3NYs/rrzABuSHVt1gYmhmTcu+wO8aRzE9NpsFkG2bVJiopUsYDgD/IUvQ84fZwiu3SuiK7B4kuXX8p1uJszGrPrqr6KjmU4Y3JCRLkunotkbyCI7vepf0mciVFugLgB27A1Ehn4/QIDAQAB", "userId": "USERC1", "corporateName": "CORPTRF", "menuCodes": ["ACCOUNT_INFORMATION", "ACCOUNT_STATEMENT", "ACCOUNT_ESTATEMENT", "TRANSFER_BCA", "TRANSFER_DOM", "TRANSFER_VA", "PAYROLL", "INQUIRY_TRANSFER_BENEFICIARY", "PAYMENT_TAX", "PAYMENT_BILL", "TRANSACTION_AUTHORIZATION", "TRANSACTION_STATUS"], "menuGroups": [], "scopes": ["EXECUTE"] }) }, body: { "account_number": "89088822", "beneficiary_bca_id": "WDWDDDD", "email": "" } }).then((response) => { // Assert response status code expect(response.status).to.eq(200); // Assert response body expect(response.body.error_schema).to.be.an('array'); expect(response.body.output_schema).to.be.an('object'); expect(response.body.output_schema.content).to.be.an('object'); // Assert specific properties in response body expect(response.body.error_schema[0].error_code).to.eq('MBB-00-004'); expect(response.body.error_schema[0].error_message.english).to.eq('Beneficiary ID has been already registered'); expect(response.body.error_schema[0].error_message.indonesian).to.eq('Beneficiary ID sudah ada pada daftar transfer'); expect(response.body.error_schema[1].error_code).to.eq('MBB-00-011'); expect(response.body.error_schema[1].error_message.english).to.eq('Account has been closed'); } }