I am using Cypress which is an automating testing ...
# suitescript
r
I am using Cypress which is an automating testing solution for end-to-end testing. When I log into NetSuite and create a bill transaction type. In NetSuite after you enter the vendor field on the bill entry form the subsidiary automatically populates but when I use Cypress to do the same process the subsidiary does not populate. I was confused about why this occurs?
b
what does the code look like
r
Cypress is built on JavaScript and only supports the Mocha JS framework
b
dont expect much help if you dont share enough information to reproduce the problem
r
I am sending the code right now
d
I assume if you run your e2e test in "headed" mode and watch what the browser is actually doing it will become more apparent I am going to guess you just need to wait longer until NS client-side behavior is able to complete
and/or the way you are manipulating the vendor field contents does not trigger NS client "fieldChanged" logic i.e. if you are just changing the backing field value, rather than changing the input in the same manner that would reflect actual user input
r
describe('Bypass Login', () => { it('NetSuite', () => { cy.typeLogin({}) cy.viewport(1500, 1000) //cy.get('.ns-role-company').click() //cy.get('#n-id-component-258').click() cy.get('#ns-header-menu-main-item2').click() cy.get('.ns-searchable-value ').contains('Enter Bills').click() //VENDOR as 3M. cy.get('#inpt_entity2').click() cy.get('#nl3').click() cy.wait(20000) }) })
This code was creating a bill the exact same way a user would create a bill and I also waited after entering the vendor field
d
does it look all correct as expected when debugging test & viewing browser in non-headless mode? if that is still the case, then I guess would recommend troubleshooting by executing similar flow with direct equivalent JS/jquery commands in browser console, to see if produces same behavior in my experience, sometimes need to manipulate inputs like one div above what you are actually targeting sometimes
and might need to add waits in between other actions as well. also generally I feel is better to "wait-until" something else occurs or is visible, rather than just waiting arbitrary milliseconds
b
your code is actually very much account specific
ns-header-menu-main-item2
relies on there being no custom tabs and that the transactions tab is second
inpt_entity2 relies on there being few enough vendors that its a list select and doesnt popup the search box
although in my account the field is inpt_entity1 and not inpt_entity2
r
Cypress will run tests headless
b
the html that netsuite can be customized
the examples i gave is that the transactions header menu that you are trying to click is not always second
and that the entity select is not always a dropdown list, actually in most cases it isnt
r
I was replicating the process for my specific account
b
if you are sure you have the correct elements
then you want to trigger a mouse down event on your select field
importantly, make sure it bubbles
the event listener for generating the vendor select is on the document