Open jorgetutor opened 3 years ago
I was thinking that there are entities without an identifiable label like the paragraph entity which uses the entity ID as the label. But it should not be important as those entities won't be accessed by URL. Indeed. I think all the entities that are accessed by URL have a label. So I think now we could deprecate the 'Last entity created' steps, and remove those steps in a 2.x version.
I have just one question (maybe I am overthinking): are these steps helping to make proper BDD? I mean, BDD tests try to imitate the behaviour of a real user. But all these steps are shortcuts to go to pages. What it does is go to a page/subpage by writing the URL. But user do not usually write URLs in the browser. For example, a user does not go to the article 'Multiple databases on a single instance on Drupal 9' of metadrop.net, the user goes first to the front page, then click 'Articles', and then click on that article.
In that case, maybe we could remove all these steps, in favour of doing steps that involves doing the real user actions on the site. What do you think?
That's indeed a legitimate concern.
I don't like this kind of steps either because of what you explain. But I accepted them because they were needed in some cases, if I'm not wrong. However, I don't recall those cases and anyway I think we should revisit them and try to accomplish those cases without this kind of steps.
I would review our projects to see in which cases we use those steps and see if you can get rid of them. If yes, I would mark them as deprecated.
For the moment I will focus on the main topic of the issue. After removing "last entity created" steps, we can think later if we can remove all the steps, or maintain them as utilities in case we want shortcut steps when we don't want to execute each task manually, which is tested otherwhere.
I've checked our projects and the usage I see we use for "last entity created" is:
Projects using this will need a short time to adapt, and I think that now with the new steps we have, having a step to go to the last entity created becomes unnecessary.
We can do a release that throws the warning, and another release that removes the step.
There are several steps with "last entity created", I am afraid we are overusing it when it should be only used in one scenario: when we don't know the name of the entity.
When we know the name, we should always use the steps "entity with the label" as it is more BDD-oriented and clearer to understand what are you testing.
Last entity created
Entity with label