Exemplo n.º 1
0
        $I->wait(2);
        $I->click('Publish', '#publishing-action');
        $I->see('Post Published');
        $I->seeCheckboxIsChecked('#pubcode_' . $authcode['name']);
    }
    $I->amGoingTo('Log Out so we can check that the content is password protected');
    $WP->logout();
    $I->amGoingTo('Test the protected content');
    foreach ($pubcodes[$a] as $authcode) {
        $I->amOnPage('/');
        $I->click('Test Post for ' . $authcode['description']);
        $I->see('Enter your username and password below');
        $I->fillField('log', $sample_accounts[$a]['username']);
        $I->fillField('pwd', $sample_accounts[$a]['password']);
        $I->click('Log In');
        $I->see($sample_accounts[$a]['expected_results'][$authcode['name']]);
        $WP->logout();
    }
    $I->amGoingTo('Log in as admin');
    $WP->admin_login();
    $I->amGoingTo('Delete the ' . $a . ' pubcodes');
    $I->amOnPage($plugins['auth']['admin_page']);
    foreach ($pubcodes[$a] as $authcode) {
        $I->amGoingTo('Delete ' . $authcode['name']);
        $I->click('#delete_' . $authcode['name']);
        $I->acceptPopup();
        $I->waitForJS('return jQuery.active == 0', 5);
        $I->dontSee($authcode['description']);
    }
    $WP->logout();
}