Example #1
0
 public function providerCorrectPage()
 {
     $page1 = new Page();
     $page1->setKey('catalog-product-edit');
     $page1->setTitle('Catalog product edit page');
     $page1->setUrl('admin/catalog_product/edit/id/(\\d+)');
     $tabGeneral = $page1->createTab('general', "//div=[@id='product_info_tabs_group_7_content']");
     $tabGeneral->appendChild($page1->createField('name', "//input[@id='name']"));
     $tabGeneral->appendChild($page1->createField('description', "//input[@id='description']"));
     $tabGeneral->appendChild($page1->createSelect('status', "//input[@id='status']"));
     $page1->documentElement->appendChild($tabGeneral);
     $page1->documentElement->appendChild($page1->createButton('save', "//div[@class='content-buttons-placeholder']//button[contains(@class,'save')]"));
     $page1->documentElement->appendChild($page1->createButton('back', "//div[@class='content-buttons-placeholder']//button[contains(@class,'back')]"));
     $page2 = new Page();
     $page2->setKey('customer-edit');
     $page2->setTitle('Cutomer edit page');
     $page2->setUrl('admin/customer/edit/id/(\\d+)');
     $fieldsetAccountInformation = $page2->createFieldset('account-information', "//div[@id='_accountbase_fieldset']");
     $fieldsetAccountInformation->appendChild($page2->createField('firstname', "//input[@id='_accountfirstname']"));
     $fieldsetAccountInformation->appendChild($page2->createField('lastname', "//input[@id='_accountlastname']"));
     $fieldsetAccountInformation->appendChild($page2->createSelect('gender', "//input[@id='_accountgender']"));
     $fieldsetFormButtons = $page2->createFieldset('form-buttons', "//p[@class='form-buttons']");
     $fieldsetFormButtons->appendChild($page2->createButton('save', "//div[@class='content-buttons-placeholder']//button[contains(@class,'save')]"));
     $fieldsetFormButtons->appendChild($page2->createButton('back', "//div[@class='content-buttons-placeholder']//button[contains(@class,'back')]"));
     $tabAccountInformation = $page2->createTab('account-information', "//div[@id='_accountbase_fieldset']");
     $tabAccountInformation->appendChild($fieldsetAccountInformation);
     $page2->documentElement->appendChild($tabAccountInformation);
     $page2->documentElement->appendChild($fieldsetFormButtons);
     return array(array($page1), array($page2));
 }