cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
47.03k stars 3.19k forks source link

Click is not working in toggle dropdown menu option from angular application #18203

Closed nileshraval closed 1 year ago

nileshraval commented 3 years ago

Current behavior

Cypress is click on this element option as "Manage til " but it does not open page. see attached video.

https://www.loom.com/share/c2efdf35cdea4aa7b8f9d10351950854

Desired behavior

it should click on this element. here is code as per page object model

  element.ManageTills().should('be.visible').trigger('mouseover').click()

Test code to reproduce

export default class Retail_Manage_Tills_Elements
{

   Retail()
   {

    return cy.get('#nav-retail > div > p')

   }

    Tillmodule() {
        //return cy.xpath("//span[normalize-space()='Tills']")
        return cy.get('body.ng-scope:nth-child(2) div.main div.wrapper div.page-area div.content-view-container.ng-scope ui-view.ng-scope app.ng-scope.ng-isolate-scope div.main_container:nth-child(1) ui-view.ng-scope retail.ng-scope.ng-isolate-scope div.module-tabs-row:nth-child(1) div.module-tabs-container module-tabs.ng-isolate-scope div.module-tabs-section-tab-background.wmsight-submodule-tab-background-row div.module-tabs-component-tab-list.wmsight-submodule-tab-list.ng-isolate-scope ul.nav.nav-tabs li.module-tabs-component-tab-list-item.module-tabs-tab-2.wmsight-submodule-tab-2.wmsight-submodule-tab-registers.wmsight-submodule-tab.uib-tab.nav-item:nth-child(3) a.nav-link.ng-binding uib-tab-heading.module-tabs-component-tab-list-item-heading.ng-scope.dropdown-tab-heading span.module-tabs-component-tab-list-heading-dropdown.dropdown.ng-scope > span.module-tabs-component-tab-list-heading-dropdown-toggle.dropdown-toggle.module-tab-menu-items.ng-binding')
    }
    ManageTills(){
        //return cy.xpath("//li[3]/a[1]/uib-tab-heading[1]/span[1]/ul[1]/li[1]")
        return cy.get('.module-tabs-tab-2 > .nav-link > .module-tabs-component-tab-list-item-heading > .module-tabs-component-tab-list-heading-dropdown > .module-tabs-component-tab-list-dropdown-menu > :nth-child(1) > .module-tabs-menu-items')
    }

    Tillmenu(){
        return cy.get('span[class="module-tabs-component-tab-list-heading-dropdown dropdown ng-scope open"] ul[class="module-tabs-component-tab-list-dropdown-menu dropdown-menu"]')
    }

Cypress Version

8.1.0

Other

No response

cypress-app-bot commented 1 year ago

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

cypress-app-bot commented 1 year ago

This issue has been closed due to inactivity.