Is there a way to assert the CSS width of an element in NightwatchJS to be 100% without hard-coding the value? Currently, when I attempt to do so, it fails and reports that the width is 196px. The specific error message is as follows:
Testing if element <[data-e2e="base-button"][class="xs block"]> has css property "width: 100%". - Expected "100%" but got: "196px"
I have experimented with different syntaxes to achieve the desired outcome:
page.assert.cssProperty(`@button-element`, 'width', '100%');
page.expect.element(`@${element}`).to.have.css("width").which.equals("100%");
In order to account for varying container widths, I prefer not to rely on hardcoded values. What alternative approach should I take?
Although I am utilizing the Page Object Model, I am open to exploring other methods if needed.