public function fillInHouseAddress() { $I = $this; $I->wantTo('Fill in House object address'); $I->click(AddAdvert::$regionField); $I->fillField(AddAdvert::$typeRegion, House::region); $I->click(AddAdvert::$region0); $I->click(AddAdvert::$cityField); $I->fillField(AddAdvert::$typeCity, House::city); $I->click(AddAdvert::$chooseCity); $I->click(AddAdvert::$district); $I->fillField(AddAdvert::$typeDistrict, House::district); $I->click(AddAdvert::$chooseDistrict); $I->click(AddAdvert::$street); $I->fillField(AddAdvert::$typeStreet, House::street); $I->click(AddAdvert::$chooseStreet); $I->fillField(AddAdvert::$house_number, House::uniqueHouseNumber()); $I->click(AddAdvert::$buttonSubmit); $I->wait(2); }
function realtyHousesEdit() { $adminToken = file_get_contents(codecept_data_dir('admin_token.json')); $schema = file_get_contents(codecept_data_dir('schema_id.json')); $realtyHouseID = file_get_contents(codecept_data_dir('realtyHouseId.json')); $this->restModule->haveHttpHeader('token', $adminToken); $this->restModule->haveHttpHeader('Content-Type', 'application/json'); $this->restModule->sendPUT('/realties/houses/edit/' . $realtyHouseID, ['status' => 1, 'region' => $this->getRegion(21), 'city' => $this->getCity(4), 'street' => $this->getStreet(21), 'houseNumber' => House::uniqueHouseNumber(), 'latitude' => House::editLatitude, 'longitude' => House::editLongitude, 'area' => House::generalArea, 'areaUnit' => $this->getAreaUnits(0), 'livingArea' => House::editLivingArea, 'kitchenArea' => House::editKitchenArea, 'landArea' => House::editLandArea, 'landAreaUnit' => $this->getAreaUnits(1), 'roomCount' => House::editRoomCount, 'wallMaterial' => $this->getWallMaterials(1), 'floorNumber' => House::editFloors, 'buildYear' => House::editBuildYear, 'wc' => $this->getWC(1), 'heating' => $this->getHeatings(1), 'waterHeating' => $this->getWaterHeatings(1), 'communication' => [$this->getCommunications(0), $this->getCommunications(1), $this->getCommunications(2), $this->getCommunications(3), $this->getCommunications(4), $this->getCommunications(5), $this->getCommunications(6), $this->getCommunications(7)], 'nearObjects' => [$this->getNearObjects(0), $this->getNearObjects(1), $this->getNearObjects(2), $this->getNearObjects(3), $this->getNearObjects(4), $this->getNearObjects(5), $this->getNearObjects(6), $this->getNearObjects(7), $this->getNearObjects(8), $this->getNearObjects(9)], 'schema' => $schema]); $realtyHouse = $this->restModule->grabResponse(); $realtyEditHouseId = json_decode($realtyHouse)->id; if ($realtyHouseID === $realtyEditHouseId) { file_put_contents(codecept_data_dir('realtyHouseId.json'), $realtyEditHouseId); } $this->debugSection('realtyEditHouseId', $realtyEditHouseId); $this->restModule->seeResponseCodeIs(200); $this->restModule->seeResponseIsJson(); }
public function editHouseObject() { $I = $this; $I->waitForElement(AdmRealtyObject::$yandexMap); $I->click(AdmRealtyObject::$statusField); $I->waitForElement(AdmRealtyObject::$objStatus1); $I->click(AdmRealtyObject::$objStatus1); $I->click(AdmRealtyObject::$regionField); $I->fillField(AdmRealtyObject::$typeRegion, House::region); $I->click(AdmRealtyObject::$region0); $I->click(AdmRealtyObject::$cityField); $I->fillField(AdmRealtyObject::$typeCity, House::city); $I->click(AdmRealtyObject::$city0); $I->click(AdmRealtyObject::$districtField); $I->click(AdmRealtyObject::$district3); $I->click(AdmRealtyObject::$street); $I->fillField(AdmRealtyObject::$typeStreet, House::editStreet); $I->click(AdmRealtyObject::$chooseStreet); $I->fillField(AdmRealtyObject::$house_number, House::uniqueHouseNumber()); $I->fillField(AdmRealtyObject::$generalArea, House::editGeneralArea); $I->click(AdmRealtyObject::$areaUnitField); $I->click(AdmRealtyObject::$areaUnit0); $I->click(AdmRealtyObject::$wallMaterialField); $I->click(AdmRealtyObject::$wallMaterial3); $I->fillField(AdmRealtyObject::$roomСount, House::editRoomCount); $I->fillField(AdmRealtyObject::$livingArea, House::editLivingArea); $I->fillField(AdmRealtyObject::$kitchenArea, House::editKitchenArea); $I->fillField(AdmRealtyObject::$landArea, House::editLandArea); $I->click(AdmRealtyObject::$landAreaUnit); $I->click(AdmRealtyObject::$areaUnit1); $I->fillField(AdmRealtyObject::$floors, House::editFloors); $I->fillField(AdmRealtyObject::$buildYear, House::editBuildYear); $I->click(AdmRealtyObject::$wcField); $I->click(AdmRealtyObject::$wc2); $I->click(AdmRealtyObject::$heatingField); $I->click(AdmRealtyObject::$heating3); $I->click(AdmRealtyObject::$waterHeatingField); $I->click(AdmRealtyObject::$waterHeat3); $I->click(AdmRealtyObject::$communication0); $I->click(AdmRealtyObject::$communication1); $I->click(AdmRealtyObject::$communication2); $I->click(AdmRealtyObject::$communication3); $I->click(AdmRealtyObject::$communication4); $I->click(AdmRealtyObject::$communication5); $I->click(AdmRealtyObject::$communication6); $I->click(AdmRealtyObject::$communication7); $I->click(AdmRealtyObject::$nearObject0); $I->click(AdmRealtyObject::$nearObject1); $I->click(AdmRealtyObject::$nearObject2); $I->click(AdmRealtyObject::$nearObject3); $I->click(AdmRealtyObject::$nearObject4); $I->click(AdmRealtyObject::$nearObject5); $I->click(AdmRealtyObject::$nearObject6); $I->click(AdmRealtyObject::$nearObject7); $I->click(AdmRealtyObject::$nearObject8); $I->click(AdmRealtyObject::$nearObject9); $I->attachFile(AdmRealtyObject::$schema, '/img/house_2.jpg'); $I->wait(1); $I->click(AdmRealtyObject::$submitBtn); $I->wait(2); }