Deleting a post

This test case deals with deleting a post, using the following code:

@Test (dependsOnMethods = "testEditPost")public void testDeletePost() {    AdminLoginPage loginPage =            PageFactory.initElements(driver, AdminLoginPage.class);    AllPostsPage allPostsPage = loginPage.login(username, password);    allPostsPage.deleteAPost("Editing Post using PageObjects");}

The following is the sequence of steps executed in the preceding test script to test the deleting of a post in the WordPress blog:

  1. It creates an instance of the AdminLoginPage PageObject that uses the same driver instance created in the previous step.
  2. Once it gets the instance of the AdminLoginPage PageObject, it uses the login service to log into the WordPress Admin console. The ...

Get Selenium WebDriver 3 Practical Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.