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:
- It creates an instance of the AdminLoginPage PageObject that uses the same driver instance created in the previous step.
- Once it gets the instance of the AdminLoginPage PageObject, it uses the login service to log into the WordPress Admin console. The ...