Skip to content

E2E Utils: Return block locator from createBlock()#55851

Closed
WunderBart wants to merge 1 commit intotrunkfrom
add/e2e-return-locator-from-create-block
Closed

E2E Utils: Return block locator from createBlock()#55851
WunderBart wants to merge 1 commit intotrunkfrom
add/e2e-return-locator-from-create-block

Conversation

@WunderBart
Copy link
Copy Markdown
Member

What?

Why?

How?

Testing Instructions

Testing Instructions for Keyboard

Screenshots or screencast

return block;
}, blockRepresentation );

return this.canvas.locator( `#block-${ clientId }` );
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested this, but one issue I can see is that if you reload the page after block insertion and try to use this locator in assertion, it will fail.

Copy link
Copy Markdown
Member Author

@WunderBart WunderBart Nov 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! I assumed the ID is persistent, so GTK it's not. 😄 At this point, I can't see any other persistent value of a newly inserted block that we could reference, so this isn't going to work. Closing!

@WunderBart
Copy link
Copy Markdown
Member Author

See #55851 (comment)

@WunderBart WunderBart closed this Nov 6, 2023
@WunderBart WunderBart deleted the add/e2e-return-locator-from-create-block branch November 6, 2023 15:13
@Mamaduka
Copy link
Copy Markdown
Member

Mamaduka commented Nov 6, 2023

Thanks for taking the time and exploring this idea!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants