示例#1
0
<?php

$I = new WebGuy($scenario);
$WP = new wordpress_controller($I);
$I->wantTo('Test the Authentication Plugin');
$WP->admin_login('admin', 'password');
$I->resizeWindow(1280, 1024);
$I->see('Dashboard');
$WP->enable_plugins($plugins);
$WP->logout();
foreach ($affiliates as $a) {
    $I->amGoingTo('Input settings for the base plugin');
    $WP->admin_login();
    $I->amOnPage($plugins['base']['admin_page']);
    // Fill out the form
    $I->fillField('agora_core_framework_config[prod_token]', $mw_settings[$a]['prod_token']);
    $I->fillField('agora_core_framework_config[uat_token]', $mw_settings[$a]['uat_token']);
    $I->click('Save');
    $I->amGoingTo('Configure some Authcodes');
    $I->amOnPage($plugins['auth']['admin_page']);
    $I->see('Add new Authentication Code');
    foreach ($pubcodes[$a] as $authcode) {
        $I->fillField('#add_new_authcode .authcode_name', $authcode['name']);
        $I->fillField('#add_new_authcode .authcode_advantage_code', $authcode['advantage_code']);
        $I->fillField('#add_new_authcode .authcode_description', $authcode['description']);
        $I->selectOption('#add_new_authcode .authcode_type', $authcode['auth_type']);
        $I->click('Add New', '#add_new_authcode');
        $I->waitForJS('return jQuery.active == 0', 5);
        $I->see($authcode['description']);
    }
    $I->amGoingTo('Insert some Test Content');