magnificent-finland-58048
04/11/2022, 3:14 PMflaky-airport-12178
04/12/2022, 5:33 AMflaky-airport-12178
04/12/2022, 5:33 AMflaky-airport-12178
04/12/2022, 5:34 AMflaky-airport-12178
04/12/2022, 5:34 AMgreen-boots-72737
04/12/2022, 11:39 AMit.only('toggles bold with no selection via keyboard shortcuts', () => {
function Test() {
const [value, setValue] = useState(emptyRichTextValue);
const handleChange = newValue => setValue(newValue);
return (
<RichText value={value} onChange={handleChange} />
);
}
mount(<Test />);
cy.get('[data-test-key*="rich-text"] [contenteditable]').first().click();
cy.get('body').type('{meta+b}Hello');
cy.get('[data-test-key*="rich-text"] [contenteditable]').should('have.text', 'Hello');
cy.get('[data-test-key*="rich-text"] [contenteditable] strong').should('exist');
});
Errror is
AssertionError: Timed out retrying after 4000ms: Expected to find element: `[data-test-key*="rich-text"] [contenteditable] strong`, but never found it.
creamy-train-56346
04/12/2022, 12:01 PMvisibility = hidden
in DOM. So far so good ✅
3. There is an option to complete questionnaire after proccess had finished. User clicks button to display this questionnaire => it appears, BUT there is new identicall instance of this questionnaire in DOM and according to CSS classess it's visible. ✅
So right now in DOM we have 2 questionnaires - one hidden which is of no interest to me and second one which is visible (acc. to CSS at least).
4. Cypress tries to grab some field from second questionaire but it fails. I'm getting error from screenshot. 📛
I did some debugging and found out that Cypress doesn't see second questionnaire at all. It keeps founding only hidden questionnaire. Explicit wait doesn't even work, which leads me to conclusion that I'm missing something about cy.get
. Yet I didn't find anuything helpful online :< Maybe you could help out? 🙂flaky-solstice-32551
04/12/2022, 5:19 PMflaky-solstice-32551
04/12/2022, 5:32 PMnumerous-kangaroo-93739
04/13/2022, 12:13 AMmagnificent-finland-58048
04/13/2022, 5:02 AMmagnificent-finland-58048
04/13/2022, 5:08 AMmagnificent-finland-58048
04/13/2022, 5:11 AMgray-kilobyte-89541
04/13/2022, 10:44 AMmagnificent-finland-58048
04/13/2022, 11:10 AMgentle-yacht-11391
04/13/2022, 2:51 PMcreamy-train-56346
04/14/2022, 11:53 AM.length
keeps returning 1 element only (hidden one).creamy-train-56346
04/14/2022, 11:55 AMflaky-solstice-32551
04/14/2022, 11:57 AMcreamy-train-56346
04/14/2022, 2:03 PMcy.get('#questionnaire')
. Take a look. In the screenshots you can see that despite waiting 5s Cypress keeps finding only one instance of this id. I also provided ss from devtools showing that there are in fact 2 questionnaires and only one has class hidden
.flaky-solstice-32551
04/14/2022, 2:12 PMfresh-doctor-14925
04/14/2022, 4:11 PM#questionnaire
(the one you're interested in), is it housed within an iframe
?creamy-train-56346
04/14/2022, 4:12 PMfast-teacher-87788
04/14/2022, 8:14 PMistextorbinary
to test the payload from the fixture, and it is detected as binary.late-house-1562
04/14/2022, 11:17 PMts
expect(response.body).to.be.instanceOf(Array)
sh
AssertionError: expected [ Array(1216) ] to be an instance of Array
I wasn't worried about the length.
How should I be doing this test?late-house-1562
04/14/2022, 11:54 PMexpect(response.body).to.be.an("array")
boundless-wall-32593
04/15/2022, 7:31 AMbeforeEach()
hook? I see the new url event, but I still don't understand why does it happening, since in the beforeEach() hook I only preserve cookies and do some API calls, so I don't want/need to have my baseUrl page loaded...fresh-doctor-14925
04/15/2022, 9:55 AMit.only()
in that second scenarioboundless-wall-32593
04/15/2022, 1:13 PMfresh-doctor-14925
04/15/2022, 1:16 PM