I try to check is selected option realy selected in drop down list (select):
expect(page.sltMembers_element.options).to eql('John Doe')
But I get an error that expected: 'John Doe' and got: list of all options from drop down list.
I try to check is selected option realy selected in drop down list (select):
expect(page.sltMembers_element.options).to eql('John Doe')
But I get an error that expected: 'John Doe' and got: list of all options from drop down list.
Copyright © 2021 Jogjafile Inc.
Assuming that the
sltMembers_elementmethod is the one generated by theselect_listaccessor, then the page-object will have 5 methods:sltMembersreturns the currently selected item text.sltMembers=selects an item.sltMembers_elementreturns the page-object element.sltMembers?checks if the element is present.sltMembers_optionsgets an array of all available options.As you want to check the selected option, you want to call the page's
sltMembersmethod: