It would be good to have a generic test which can be used to determine if a node has been saved. The default behaviour in Drupal is to take the user to the view node page (e.g. /node/123) after the saving the node.
In the original Drupal Testcafe (DT) prototype, I created a Node.checkOnNodePage() method which looks for body level classes to confirm the user is on the view node page.
However, this introduces its own problems. For example is URL aliases are enabled for the content type then after saving the, the user is redirected to the alias URI (e.g. /my/new/article).
It would be good to have a generic test which can be used to determine if a node has been saved. The default behaviour in Drupal is to take the user to the view node page (e.g.
/node/123
) after the saving the node.In the original Drupal Testcafe (DT) prototype, I created a Node.checkOnNodePage() method which looks for body level classes to confirm the user is on the view node page.
However, I have found that this class is not always present.
I was considering changing this to check the URI instead:
However, this introduces its own problems. For example is URL aliases are enabled for the content type then after saving the, the user is redirected to the alias URI (e.g.
/my/new/article
).Need to consider other options