Best Python code snippet using pyatom_python
createAccount.spec.js
Source:createAccount.spec.js
1import createAccount from "../page-object/accountPage";2import NavSection from "../page-object/nav.section";3import accountPage from "../page-object/accountPage";4import getRandomEmail from "../utils/getRandomEmail";5describe("Create account suite", () => {6 it("Verify the user able to access to Authentication SCREEN", () => {7 browser.url("");8 NavSection.submitI();9 const title = browser.getTitle();10 expect(title).toEqual("Login - My Store");11 });12 it("Verify email address format validation", () => {13 browser.url("");14 NavSection.submitI();15 accountPage.email.setValue("dawdadwaldklak.com");16 createAccount.submitBtnCreate();17 expect(createAccount.alertText()).toEqual("Invalid email address.");18 });19 it("Verify message when the client enters an unexisting-email, should be redirected to CREATE AN ACCOUNT", () => {20 browser.url("");21 NavSection.submitI();22 createAccount.email.setValue("redirected.test@gmail.com");23 createAccount.submitBtnCreate();24 const title = browser.getTitle();25 expect(title).toEqual("Login - My Store");26 });27 it("Verify message when the client enters an existing-email", () => {28 browser.url("");29 NavSection.submitI();30 createAccount.email.setValue("iignacio.test@gmail.com");31 createAccount.submitBtnCreate();32 expect(createAccount.alertText()).toEqual(33 "An account using this email address has already been registered. Please enter a valid password or request a new one."34 );35 });36 it('Verify First name is required', () => {37 browser.url("");38 NavSection.submitI();39 createAccount.email.setValue(getRandomEmail());40 createAccount.submitBtnCreate();41 createAccount.submitMr();42 createAccount.lastName.setValue("Carrizo");43 createAccount.passwordCreate.setValue("abc1234");44 createAccount.address.setValue("Alvear");45 createAccount.city.setValue("Rosario");46 createAccount.dropDown.selectByVisibleText("Arizona");47 createAccount.postCode.setValue("33109");48 createAccount.phoneMobile.setValue("3421323123");49 createAccount.submitBtnReg();50 expect(createAccount.alertText()).toEqual("firstname is required.");51 });52 it('Verify maximum characters in first name', () => {53 browser.url("");54 NavSection.submitI();55 createAccount.email.setValue(getRandomEmail());56 createAccount.submitBtnCreate();57 createAccount.submitMr();58 createAccount.customerFirstName.setValue("IgnacioIgnacioIgnacioIgnacioIgnacioIgnacioIgnacio");59 createAccount.lastName.setValue("Carrizo");60 createAccount.passwordCreate.setValue("abc1234");61 createAccount.address.setValue("Alvear");62 createAccount.city.setValue("Rosario");63 createAccount.dropDown.selectByVisibleText("Arizona");64 createAccount.postCode.setValue("33109");65 createAccount.phoneMobile.setValue("3421323123");66 createAccount.submitBtnReg();67 expect(createAccount.alertText()).toEqual("firstname is too long. Maximum length: 32");68 });69 it('Verify first name cannot start with a number', () => {70 browser.url("");71 NavSection.submitI();72 createAccount.email.setValue(getRandomEmail());73 createAccount.submitBtnCreate();74 createAccount.submitMr();75 createAccount.customerFirstName.setValue("3Ignacio");76 createAccount.lastName.setValue("Carrizo");77 createAccount.passwordCreate.setValue("abc1234");78 createAccount.address.setValue("Alvear");79 createAccount.city.setValue("Rosario");80 createAccount.dropDown.selectByVisibleText("Arizona");81 createAccount.postCode.setValue("33109");82 createAccount.phoneMobile.setValue("3421323123");83 createAccount.submitBtnReg();84 expect(createAccount.alertText()).toEqual("firstname is invalid.");85 });86 it('Verify last name is required', () => {87 browser.url("");88 NavSection.submitI();89 createAccount.email.setValue(getRandomEmail());90 createAccount.submitBtnCreate();91 createAccount.submitMr();92 createAccount.customerFirstName.setValue("Ignacio");93 createAccount.passwordCreate.setValue("abc1234");94 createAccount.address.setValue("Alvear");95 createAccount.city.setValue("Rosario");96 createAccount.dropDown.selectByVisibleText("Arizona");97 createAccount.postCode.setValue("33109");98 createAccount.phoneMobile.setValue("3421323123");99 createAccount.submitBtnReg();100 expect(createAccount.alertText()).toEqual('lastname is required.');101 });102 it('Verify maximum characters in last name', () => {103 browser.url("");104 NavSection.submitI();105 createAccount.email.setValue(getRandomEmail());106 createAccount.submitBtnCreate();107 createAccount.submitMr();108 createAccount.customerFirstName.setValue("Ignacio");109 createAccount.lastName.setValue("IgnacioIgnacioIgnacioIgnacioIgnacioIgnacioIgnacio");110 createAccount.passwordCreate.setValue("abc1234");111 createAccount.address.setValue("Alvear");112 createAccount.city.setValue("Rosario");113 createAccount.dropDown.selectByVisibleText("Arizona");114 createAccount.postCode.setValue("33109");115 createAccount.phoneMobile.setValue("3421323123");116 createAccount.submitBtnReg();117 expect(createAccount.alertText()).toEqual("lastname is too long. Maximum length: 32");118 });119 it('Verify email field is required', () => {120 browser.url("");121 NavSection.submitI();122 createAccount.email.setValue(getRandomEmail());123 createAccount.submitBtnCreate();124 createAccount.submitMr();125 createAccount.customerFirstName.setValue("Ignacio");126 createAccount.lastName.setValue("Carrizo");127 createAccount.emailClear();128 createAccount.passwordCreate.setValue("abc1234");129 createAccount.address.setValue("Alvear");130 createAccount.city.setValue("Rosario");131 createAccount.dropDown.selectByVisibleText("Arizona");132 createAccount.postCode.setValue("33109");133 createAccount.phoneMobile.setValue("3421323123");134 createAccount.submitBtnReg();135 expect(createAccount.alertText()).toEqual("email is required.");136 });137 it('Verify correct validation of email', () => {138 browser.url("");139 NavSection.submitI();140 createAccount.email.setValue(getRandomEmail());141 createAccount.submitBtnCreate();142 createAccount.submitMr();143 createAccount.customerFirstName.setValue("Ignacio");144 createAccount.lastName.setValue("Carrizo");145 createAccount.emailPersonalInformation.setValue("djawddjawd.com");146 createAccount.passwordCreate.setValue("abc1234");147 createAccount.address.setValue("Alvear");148 createAccount.city.setValue("Rosario");149 createAccount.dropDown.selectByVisibleText("Arizona");150 createAccount.postCode.setValue("33109");151 createAccount.phoneMobile.setValue("3421323123");152 createAccount.submitBtnReg();153 expect(createAccount.alertText()).toEqual("email is invalid.");154 });155 it('Verify password field is required', () => {156 browser.url("");157 NavSection.submitI();158 createAccount.email.setValue(getRandomEmail());159 createAccount.submitBtnCreate();160 createAccount.submitMr();161 createAccount.customerFirstName.setValue("Ignacio");162 createAccount.lastName.setValue("Carrizo");163 createAccount.address.setValue("Alvear");164 createAccount.city.setValue("Rosario");165 createAccount.dropDown.selectByVisibleText("Arizona");166 createAccount.postCode.setValue("33109");167 createAccount.phoneMobile.setValue("3421323123");168 createAccount.submitBtnReg();169 expect(createAccount.alertText()).toEqual("passwd is required.");170 });171 it('Verify password field length cannot be less than 5 characters', () => {172 browser.url("");173 NavSection.submitI();174 createAccount.email.setValue(getRandomEmail());175 createAccount.submitBtnCreate();176 createAccount.submitMr();177 createAccount.customerFirstName.setValue("Ignacio");178 createAccount.lastName.setValue("Carrizo");179 createAccount.passwordCreate.setValue("abc");180 createAccount.address.setValue("Alvear");181 createAccount.city.setValue("Rosario");182 createAccount.dropDown.selectByVisibleText("Arizona");183 createAccount.postCode.setValue("33109");184 createAccount.phoneMobile.setValue("3421323123");185 createAccount.submitBtnReg();186 expect(createAccount.alertText()).toEqual("passwd is invalid.");187 });188 it("Verify First Name is incorrectly completed with more than 32 characters", () => {189 browser.url("");190 NavSection.submitI();191 createAccount.email.setValue(getRandomEmail());192 createAccount.submitBtnCreate();193 createAccount.submitMr();194 createAccount.customerFirstName.setValue("Ignacio");195 createAccount.lastName.setValue("Carrizo");196 createAccount.passwordCreate.setValue("abc1234");197 createAccount.firstNameYourAddress.setValue("IgnacioIgnacioIgnacioIgnacioIgnacioIgnacio");198 createAccount.address.setValue("Alvear");199 createAccount.city.setValue("Rosario");200 createAccount.dropDown.selectByVisibleText("Arizona");201 createAccount.postCode.setValue("33109");202 createAccount.phoneMobile.setValue("3421323123");203 createAccount.submitBtnReg();204 expect(createAccount.alertText()).toEqual("firstname is too long. Maximum length: 32");205 });206 it("Verify First Name cannot start with a number in your address area", () => {207 browser.url("");208 NavSection.submitI();209 createAccount.email.setValue(getRandomEmail());210 createAccount.submitBtnCreate();211 createAccount.submitMr();212 createAccount.customerFirstName.setValue("Ignacio");213 createAccount.lastName.setValue("Carrizo");214 createAccount.passwordCreate.setValue("abc1234");215 createAccount.firstNameYourAddress.setValue("3Ignacio");216 createAccount.address.setValue("Alvear");217 createAccount.city.setValue("Rosario");218 createAccount.dropDown.selectByVisibleText("Arizona");219 createAccount.postCode.setValue("33109");220 createAccount.phoneMobile.setValue("3421323123");221 createAccount.submitBtnReg();222 expect(createAccount.alertText()).toEqual("firstname is invalid.");223 });224 it("Verify First Name field is required on your address area", () => {225 browser.url("");226 NavSection.submitI();227 createAccount.email.setValue(getRandomEmail());228 createAccount.submitBtnCreate();229 createAccount.submitMr();230 createAccount.customerFirstName.setValue("Ignacio");231 createAccount.lastName.setValue("Carrizo");232 createAccount.passwordCreate.setValue("abc1234");233 createAccount.clearFirstNameYourAddress();234 createAccount.address.setValue("Alvear");235 createAccount.city.setValue("Rosario");236 createAccount.dropDown.selectByVisibleText("Arizona");237 createAccount.postCode.setValue("33109");238 createAccount.phoneMobile.setValue("3421323123");239 createAccount.submitBtnReg();240 expect(createAccount.alertText()).toEqual("firstname is required.");241 });242 it("Verify Last Name is incorrectly completed with more than 32 characters", () => {243 browser.url("");244 NavSection.submitI();245 createAccount.email.setValue(getRandomEmail());246 createAccount.submitBtnCreate();247 createAccount.submitMr();248 createAccount.customerFirstName.setValue("Ignacio");249 createAccount.lastName.setValue("Carrizo");250 createAccount.passwordCreate.setValue("abc1234");251 createAccount.lastNameYourAddress.setValue("IgnacioIgnacioIgnacioIgnacioIgnacioIgnacio");252 createAccount.address.setValue("Alvear");253 createAccount.city.setValue("Rosario");254 createAccount.dropDown.selectByVisibleText("Arizona");255 createAccount.postCode.setValue("33109");256 createAccount.phoneMobile.setValue("3421323123");257 createAccount.submitBtnReg();258 expect(createAccount.alertText()).toEqual("lastname is too long. Maximum length: 32");259 });260 it("Verify Last Name cannot start with a number in your address area", () => {261 browser.url("");262 NavSection.submitI();263 createAccount.email.setValue(getRandomEmail());264 createAccount.submitBtnCreate();265 createAccount.submitMr();266 createAccount.customerFirstName.setValue("Ignacio");267 createAccount.lastName.setValue("Carrizo");268 createAccount.passwordCreate.setValue("abc1234");269 createAccount.lastNameYourAddress.setValue("3Ignacio");270 createAccount.address.setValue("Alvear");271 createAccount.city.setValue("Rosario");272 createAccount.dropDown.selectByVisibleText("Arizona");273 createAccount.postCode.setValue("33109");274 createAccount.phoneMobile.setValue("3421323123");275 createAccount.submitBtnReg();276 expect(createAccount.alertText()).toEqual("lastname is invalid.");277 });278 it("Verify Last Name is required in your address area", () => {279 browser.url("");280 NavSection.submitI();281 createAccount.email.setValue(getRandomEmail());282 createAccount.submitBtnCreate();283 createAccount.submitMr();284 createAccount.customerFirstName.setValue("Ignacio");285 createAccount.lastName.setValue("Carrizo");286 createAccount.passwordCreate.setValue("abc1234");287 createAccount.clearLastNameYourAddress();288 createAccount.address.setValue("Alvear");289 createAccount.city.setValue("Rosario");290 createAccount.dropDown.selectByVisibleText("Arizona");291 createAccount.postCode.setValue("33109");292 createAccount.phoneMobile.setValue("3421323123");293 createAccount.submitBtnReg();294 expect(createAccount.alertText()).toEqual("lastname is required.");295 });296 297 it("Verify Company field is not allow to enter more than 64 characteres in your address area", () => {298 browser.url("");299 NavSection.submitI();300 createAccount.email.setValue(getRandomEmail());301 createAccount.submitBtnCreate();302 createAccount.submitMr();303 createAccount.customerFirstName.setValue("Ignacio");304 createAccount.lastName.setValue("Carrizo");305 createAccount.passwordCreate.setValue("abc1234");306 createAccount.company.setValue("TestIgnacioTestIgnacioTestIgnacioTestIgnacioTestIgnacioTestIgnacioTestIgnacioTestIgnacioTestIgnacioTestIgnacioTestIgnacioTestIgnacioTestIgnacioTestIgnacio")307 createAccount.address.setValue("Alvear");308 createAccount.city.setValue("Rosario");309 createAccount.dropDown.selectByVisibleText("Arizona");310 createAccount.postCode.setValue("33109");311 createAccount.phoneMobile.setValue("3421323123");312 createAccount.submitBtnReg();313 expect(createAccount.alertText()).toEqual("company is too long. Maximum length: 64");314 });315 it("Verify address is required in your address area", () => {316 browser.url("");317 NavSection.submitI();318 createAccount.email.setValue(getRandomEmail());319 createAccount.submitBtnCreate();320 createAccount.submitMr();321 createAccount.customerFirstName.setValue("Ignacio");322 createAccount.lastName.setValue("Carrizo");323 createAccount.passwordCreate.setValue("abc1234");324 createAccount.city.setValue("Rosario");325 createAccount.dropDown.selectByVisibleText("Arizona");326 createAccount.postCode.setValue("33109");327 createAccount.phoneMobile.setValue("3421323123");328 createAccount.submitBtnReg();329 expect(createAccount.alertText()).toEqual("address1 is required.");330 });331 it("Verify address field is not allows to enter more than 128 characters", () => {332 browser.url("");333 NavSection.submitI();334 createAccount.email.setValue(getRandomEmail());335 createAccount.submitBtnCreate();336 createAccount.submitMr();337 createAccount.customerFirstName.setValue("Ignacio");338 createAccount.lastName.setValue("Carrizo");339 createAccount.passwordCreate.setValue("abc1234");340 createAccount.address.setValue("Alvear125487446125487446125487446125487446125487446125487446125487446125487446125487446125487446125487446125487446125487446125487446125487446125487446125487446125487446125487446125487446125487446125487446125487446125487446125487446125487446125487446125487446125487446125487446125487446125487446125487446");341 createAccount.city.setValue("Rosario");342 createAccount.dropDown.selectByVisibleText("Arizona");343 createAccount.postCode.setValue("33109");344 createAccount.phoneMobile.setValue("3421323123");345 createAccount.submitBtnReg();346 expect(createAccount.alertText()).toEqual("address1 is too long. Maximum length: 128");347 });348 it("Verify city field is required in your address area", () => {349 browser.url("");350 NavSection.submitI();351 createAccount.email.setValue(getRandomEmail());352 createAccount.submitBtnCreate();353 createAccount.submitMr();354 createAccount.customerFirstName.setValue("Ignacio");355 createAccount.lastName.setValue("Carrizo");356 createAccount.passwordCreate.setValue("abc1234");357 createAccount.city.setValue("Rosario");358 createAccount.dropDown.selectByVisibleText("Arizona");359 createAccount.postCode.setValue("33109");360 createAccount.phoneMobile.setValue("3421323123");361 createAccount.submitBtnReg();362 expect(createAccount.alertText()).toEqual("address1 is required.");363 });364 it("Verify city field is not allow to enter more than 64 characters in your address area", () => {365 browser.url("");366 NavSection.submitI();367 createAccount.email.setValue(getRandomEmail());368 createAccount.submitBtnCreate();369 createAccount.submitMr();370 createAccount.customerFirstName.setValue("Ignacio");371 createAccount.lastName.setValue("Carrizo");372 createAccount.passwordCreate.setValue("abc1234");373 createAccount.address.setValue("Alvear");374 createAccount.city.setValue("RosarioRosarioRosarioRosarioRosarioRosarioRosarioRosarioRosarioRosarioRosarioRosarioRosarioRosarioRosarioRosarioRosarioRosarioRosarioRosarioRosarioRosario");375 createAccount.dropDown.selectByVisibleText("Arizona");376 createAccount.postCode.setValue("33109");377 createAccount.phoneMobile.setValue("3421323123");378 createAccount.submitBtnReg();379 expect(createAccount.alertText()).toEqual("city is too long. Maximum length: 64");380 });381 it("Verify state field is required in your address area", () => {382 browser.url("");383 NavSection.submitI();384 createAccount.email.setValue(getRandomEmail());385 createAccount.submitBtnCreate();386 createAccount.submitMr();387 createAccount.customerFirstName.setValue("Ignacio");388 createAccount.lastName.setValue("Carrizo");389 createAccount.passwordCreate.setValue("abc1234");390 createAccount.address.setValue("Alvear");391 createAccount.city.setValue("Rosario");392 createAccount.dropDown.selectByVisibleText("-");393 createAccount.postCode.setValue("33109");394 createAccount.phoneMobile.setValue("3421323123");395 createAccount.submitBtnReg();396 expect(createAccount.alertText()).toEqual("This country requires you to choose a State.");397 });398 it("Verify Zip/Psotal code is required in your address area", () => {399 browser.url("");400 NavSection.submitI();401 createAccount.email.setValue(getRandomEmail());402 createAccount.submitBtnCreate();403 createAccount.submitMr();404 createAccount.customerFirstName.setValue("Ignacio");405 createAccount.lastName.setValue("Carrizo");406 createAccount.passwordCreate.setValue("abc1234");407 createAccount.address.setValue("Alvear");408 createAccount.city.setValue("Rosario");409 createAccount.dropDown.selectByVisibleText("Arizona");410 createAccount.phoneMobile.setValue("3421323123");411 createAccount.submitBtnReg();412 expect(createAccount.alertText()).toEqual("The Zip/Postal code you've entered is invalid. It must follow this format: 00000");413 });414 it("Verify Zip/Psotal code is numeric with 5 characters and with format 00000 in your address area", () => {415 browser.url("");416 NavSection.submitI();417 createAccount.email.setValue(getRandomEmail());418 createAccount.submitBtnCreate();419 createAccount.submitMr();420 createAccount.customerFirstName.setValue("Ignacio");421 createAccount.lastName.setValue("Carrizo");422 createAccount.passwordCreate.setValue("abc1234");423 createAccount.address.setValue("Alvear");424 createAccount.city.setValue("Rosario");425 createAccount.dropDown.selectByVisibleText("Arizona");426 createAccount.phoneMobile.setValue("3421323123");427 createAccount.submitBtnReg();428 expect(createAccount.alertText()).toEqual("The Zip/Postal code you've entered is invalid. It must follow this format: 00000");429 });430 it("Verify Zip/Psotal code is not allow to enter more than 5 characters in your address area", () => {431 browser.url("");432 NavSection.submitI();433 createAccount.email.setValue(getRandomEmail());434 createAccount.submitBtnCreate();435 createAccount.submitMr();436 createAccount.customerFirstName.setValue("Ignacio");437 createAccount.lastName.setValue("Carrizo");438 createAccount.passwordCreate.setValue("abc1234");439 createAccount.address.setValue("Alvear");440 createAccount.city.setValue("Rosario");441 createAccount.dropDown.selectByVisibleText("Arizona");442 createAccount.postCode.setValue("331093123");443 createAccount.phoneMobile.setValue("3421323123");444 createAccount.submitBtnReg();445 expect(createAccount.alertText()).toEqual("The Zip/Postal code you've entered is invalid. It must follow this format: 00000");446 });447 it("Verify Zip/Psotal code is not allow to enter less than 5 characters in your address area", () => {448 browser.url("");449 NavSection.submitI();450 createAccount.email.setValue(getRandomEmail());451 createAccount.submitBtnCreate();452 createAccount.submitMr();453 createAccount.customerFirstName.setValue("Ignacio");454 createAccount.lastName.setValue("Carrizo");455 createAccount.passwordCreate.setValue("abc1234");456 createAccount.address.setValue("Alvear");457 createAccount.city.setValue("Rosario");458 createAccount.dropDown.selectByVisibleText("Arizona");459 createAccount.postCode.setValue("3310");460 createAccount.phoneMobile.setValue("3421323123");461 createAccount.submitBtnReg();462 expect(createAccount.alertText()).toEqual("The Zip/Postal code you've entered is invalid. It must follow this format: 00000");463 });464 it("Verify Country is required in your address area", () => {465 browser.url("");466 NavSection.submitI();467 createAccount.email.setValue(getRandomEmail());468 createAccount.submitBtnCreate();469 createAccount.submitMr();470 createAccount.customerFirstName.setValue("Ignacio");471 createAccount.lastName.setValue("Carrizo");472 createAccount.passwordCreate.setValue("abc1234");473 createAccount.address.setValue("Alvear");474 createAccount.city.setValue("Rosario");475 createAccount.dropDown.selectByVisibleText("Arizona");476 createAccount.postCode.setValue("33109");477 createAccount.country.selectByVisibleText("-");478 createAccount.phoneMobile.setValue("3421323123");479 createAccount.submitBtnReg();480 expect(createAccount.alertText()).toEqual("id_country is required.");481 });482 it("Verify additional information is not allow to enter more than 300 characters", () => {483 browser.url("");484 NavSection.submitI();485 createAccount.email.setValue(getRandomEmail());486 createAccount.submitBtnCreate();487 createAccount.submitMr();488 createAccount.customerFirstName.setValue("Ignacio");489 createAccount.lastName.setValue("Carrizo");490 createAccount.passwordCreate.setValue("abc1234");491 createAccount.address.setValue("Alvear");492 createAccount.city.setValue("Rosario");493 createAccount.dropDown.selectByVisibleText("Arizona");494 createAccount.postCode.setValue("33109");495 createAccount.additionalInfo.setValue("TEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300CharacteresTEST300Characteres");496 createAccount.phoneMobile.setValue("3421323123");497 createAccount.submitBtnReg();498 expect(createAccount.alertText()).toEqual("other is too long. Maximum length: 300")499 });500 it("Verify Mobile phone field is required in your address area", () => {501 browser.url("");502 503 NavSection.submitI();504 createAccount.email.setValue(getRandomEmail());505 createAccount.submitBtnCreate();506 createAccount.submitMr();507 createAccount.customerFirstName.setValue("Ignacio");508 createAccount.lastName.setValue("Carrizo");509 createAccount.passwordCreate.setValue("abc1234");510 createAccount.address.setValue("Alvear");511 createAccount.city.setValue("Rosario");512 createAccount.dropDown.selectByVisibleText("Arizona");513 createAccount.postCode.setValue("33109");514 createAccount.submitBtnReg();515 expect(createAccount.alertText()).toEqual("You must register at least one phone number.")516 });517 it("Verify Mobile is not allow to enter characters", () => {518 browser.url("");519 NavSection.submitI();520 createAccount.email.setValue(getRandomEmail());521 createAccount.submitBtnCreate();522 createAccount.submitMr();523 createAccount.customerFirstName.setValue("Ignacio");524 createAccount.lastName.setValue("Carrizo");525 createAccount.passwordCreate.setValue("abc1234");526 createAccount.address.setValue("Alvear");527 createAccount.city.setValue("Rosario");528 createAccount.dropDown.selectByVisibleText("Arizona");529 createAccount.postCode.setValue("33109");530 createAccount.phoneMobile.setValue("asdawdasd");531 createAccount.submitBtnReg();532 expect(createAccount.alertText()).toEqual("phone_mobile is invalid.")533 });534 it("Verify Home phone is not allow to enter characters", () => {535 browser.url("");536 NavSection.submitI();537 createAccount.email.setValue(getRandomEmail());538 createAccount.submitBtnCreate();539 createAccount.submitMr();540 createAccount.customerFirstName.setValue("Ignacio");541 createAccount.lastName.setValue("Carrizo");542 createAccount.passwordCreate.setValue("abc1234");543 createAccount.address.setValue("Alvear");544 createAccount.city.setValue("Rosario");545 createAccount.dropDown.selectByVisibleText("Arizona");546 createAccount.postCode.setValue("33109");547 createAccount.phone.setValue("dadasdawdasd")548 createAccount.phoneMobile.setValue("15516123156");549 createAccount.submitBtnReg();550 expect(createAccount.alertText()).toEqual("phone is invalid.")551 });552 it("Verify behavior of register button", () => {553 browser.url("");554 NavSection.submitI();555 createAccount.email.setValue(getRandomEmail());556 createAccount.submitBtnCreate();557 createAccount.submitMr();558 createAccount.customerFirstName.setValue("Ignacio");559 createAccount.lastName.setValue("Carrizo");560 createAccount.passwordCreate.setValue("abc1234");561 createAccount.address.setValue("Alvear");562 createAccount.city.setValue("Rosario");563 createAccount.dropDown.selectByVisibleText("Arizona");564 createAccount.postCode.setValue("33109");565 createAccount.phoneMobile.setValue("3421323123");566 createAccount.submitBtnReg();567 const title = browser.getTitle();568 569 expect(title).toEqual("My account - My Store");570 });...
RUNAPPLICATIONSUBMITAFTEREVENT.js
Source:RUNAPPLICATIONSUBMITAFTEREVENT.js
1/*------------------------------------------------------------------------------------------------------/2| Program : RUNAPPLICATIONSUBMITAFTEREVENT.js3| Event : run application submit after event4|5| Usage : to run the ASA event for specific cap6| Notes : 7| Created by : Haitham Eleisah8| Created at : 19/10/2017 15:45:489|10/------------------------------------------------------------------------------------------------------*/11function RunApplicationSubmitAfterEvent(newCapId) {12 //Set Variables13 //Save the existing system variables so that they can be reset after the function14 var pvScriptName = vScriptName;15 var pvEventName = vEventName;16 var pprefix = ((typeof prefix === 'undefined') ? null : prefix);17 var pcapId = capId;18 var pcap = cap;19 var pcapIDString = capIDString;20 var pappTypeResult = appTypeResult;21 var pappTypeString = appTypeString;22 var pappTypeArray = appTypeArray;23 var pcapName = capName;24 var pcapStatus = capStatus;25 var pfileDateObj = fileDateObj;26 var pfileDate = fileDate;27 var pfileDateYYYYMMDD = fileDateYYYYMMDD;28 var pparcelArea = parcelArea;29 var pestValue = estValue;30 var pbalanceDue = balanceDue;31 var phouseCount = houseCount;32 var pfeesInvoicedTotal = feesInvoicedTotal;33 var pcapDetail = capDetail;34 var pAInfo = AInfo;35 var ppartialCap;36 if (typeof (partialCap) !== "undefined") {37 ppartialCap = partialCap;38 } else {39 ppartialCap = null;40 }41 var pparentCapId;42 if (typeof (parentCapId) !== "undefined") {43 pparentCapId = parentCapId;44 } else {45 pparentCapId = null;46 }47 var pCreatedByACA;48 if (typeof (CreatedByACA) !== "undefined") {49 pCreatedByACA = CreatedByACA;50 } else {51 CreatedByACA = 'N';52 }53 //read ASA Specific variables from session.54 var OLDAdditionalInfoBuildingCount = aa.env.getValue("AdditionalInfoBuildingCount");55 var OLDAdditionalInfoConstructionTypeCode = aa.env.getValue("AdditionalInfoConstructionTypeCode");56 var OLDAdditionalInfoHouseCount = aa.env.getValue("AdditionalInfoHouseCount");57 var OLDAdditionalInfoPublicOwnedFlag = aa.env.getValue("AdditionalInfoPublicOwnedFlag");58 var OLDAdditionalInfoValuation = aa.env.getValue("AdditionalInfoValuation");59 var OLDAdditionalInfoWorkDescription = aa.env.getValue("AdditionalInfoWorkDescription");60 var OLDAddressCity = aa.env.getValue("AddressCity");61 var OLDAddressHouseFraction = aa.env.getValue("AddressHouseFraction");62 var OLDAddressHouseNumber = aa.env.getValue("AddressHouseNumber");63 var OLDAddressLine1 = aa.env.getValue("AddressLine1");64 var OLDAddressLine2 = aa.env.getValue("AddressLine2");65 var OLDAddressPrimaryFlag = aa.env.getValue("AddressPrimaryFlag");66 var OLDAddressState = aa.env.getValue("AddressState");67 var OLDAddressStreetDirection = aa.env.getValue("AddressStreetDirection");68 var OLDAddressStreetName = aa.env.getValue("AddressStreetName");69 var OLDAddressStreetSuffix = aa.env.getValue("AddressStreetSuffix");70 var OLDAddressType = aa.env.getValue("AddressType");71 var OLDAddressUnitNumber = aa.env.getValue("AddressUnitNumber");72 var OLDAddressUnitType = aa.env.getValue("AddressUnitType");73 var OLDAddressValidatedNumber = aa.env.getValue("AddressValidatedNumber");74 var OLDAddressZip = aa.env.getValue("AddressZip");75 var OLDAppDetailFirstIssuedDate = aa.env.getValue("AppDetailFirstIssuedDate");76 var OLDAppDetailStatusReason = aa.env.getValue("AppDetailStatusReason");77 var OLDApplicantAddressLine1 = aa.env.getValue("ApplicantAddressLine1");78 var OLDApplicantAddressLine2 = aa.env.getValue("ApplicantAddressLine2");79 var OLDApplicantAddressLine3 = aa.env.getValue("ApplicantAddressLine3");80 var OLDApplicantBirthDate = aa.env.getValue("ApplicantBirthDate");81 var OLDApplicantBusinessName = aa.env.getValue("ApplicantBusinessName");82 var OLDApplicantCity = aa.env.getValue("ApplicantCity");83 var OLDApplicantContactAddressModelList = aa.env.getValue("ApplicantContactAddressModelList");84 var OLDApplicantContactType = aa.env.getValue("ApplicantContactType");85 var OLDApplicantCountry = aa.env.getValue("ApplicantCountry");86 var OLDApplicantEmail = aa.env.getValue("ApplicantEmail");87 var OLDApplicantFaxCountryCode = aa.env.getValue("ApplicantFaxCountryCode");88 var OLDApplicantFirstName = aa.env.getValue("ApplicantFirstName");89 var OLDApplicantGender = aa.env.getValue("ApplicantGender");90 var OLDApplicantId = aa.env.getValue("ApplicantId");91 var OLDApplicantLastName = aa.env.getValue("ApplicantLastName");92 var OLDApplicantMiddleName = aa.env.getValue("ApplicantMiddleName");93 var OLDApplicantNamesuffix = aa.env.getValue("ApplicantNamesuffix");94 var OLDApplicantPhone1 = aa.env.getValue("ApplicantPhone1");95 var OLDApplicantPhone1CountryCode = aa.env.getValue("ApplicantPhone1CountryCode");96 var OLDApplicantPhone2 = aa.env.getValue("ApplicantPhone2");97 var OLDApplicantPhone2CountryCode = aa.env.getValue("ApplicantPhone2CountryCode");98 var OLDApplicantPhone3 = aa.env.getValue("ApplicantPhone3");99 var OLDApplicantPhone3CountryCode = aa.env.getValue("ApplicantPhone3CountryCode");100 var OLDApplicantPostOfficeBox = aa.env.getValue("ApplicantPostOfficeBox");101 var OLDApplicantRelation = aa.env.getValue("ApplicantRelation");102 var OLDApplicantSalutation = aa.env.getValue("ApplicantSalutation");103 var OLDApplicantState = aa.env.getValue("ApplicantState");104 var OLDApplicantZip = aa.env.getValue("ApplicantZip");105 var OLDApplicationStatus = aa.env.getValue("ApplicationStatus");106 var OLDApplicationSubmitMode = aa.env.getValue("ApplicationSubmitMode");107 var OLDApplicationTypeLevel1 = aa.env.getValue("ApplicationTypeLevel1");108 var OLDApplicationTypeLevel2 = aa.env.getValue("ApplicationTypeLevel2");109 var OLDApplicationTypeLevel3 = aa.env.getValue("ApplicationTypeLevel3");110 var OLDApplicationTypeLevel4 = aa.env.getValue("ApplicationTypeLevel4");111 var OLDCAEAddressLine1 = aa.env.getValue("CAEAddressLine1");112 var OLDCAEAddressLine2 = aa.env.getValue("CAEAddressLine2");113 var OLDCAEAddressLine3 = aa.env.getValue("CAEAddressLine3");114 var OLDCAEBirthDate = aa.env.getValue("CAEBirthDate");115 var OLDCAEBusinessName = aa.env.getValue("CAEBusinessName");116 var OLDCAEBusName2 = aa.env.getValue("CAEBusName2");117 var OLDCAECity = aa.env.getValue("CAECity");118 var OLDCAECountry = aa.env.getValue("CAECountry");119 var OLDCAECountryCode = aa.env.getValue("CAECountryCode");120 var OLDCAEEmail = aa.env.getValue("CAEEmail");121 var OLDCAEFirstName = aa.env.getValue("CAEFirstName");122 var OLDCAEGender = aa.env.getValue("CAEGender");123 var OLDCAELastName = aa.env.getValue("CAELastName");124 var OLDCAELienseNumber = aa.env.getValue("CAELienseNumber");125 var OLDCAELienseType = aa.env.getValue("CAELienseType");126 var OLDCAEMiddleName = aa.env.getValue("CAEMiddleName");127 var OLDCAEPhone1 = aa.env.getValue("CAEPhone1");128 var OLDCAEPhone2 = aa.env.getValue("CAEPhone2");129 var OLDCAEPhone2CountryCode = aa.env.getValue("CAEPhone2CountryCode");130 var OLDCAEPhone3 = aa.env.getValue("CAEPhone3");131 var OLDCAEPhone3CountryCode = aa.env.getValue("CAEPhone3CountryCode");132 var OLDCAEPostOfficeBox = aa.env.getValue("CAEPostOfficeBox");133 var OLDCAESalutation = aa.env.getValue("CAESalutation");134 var OLDCAEState = aa.env.getValue("CAEState");135 var OLDCAESuffixName = aa.env.getValue("CAESuffixName");136 var OLDCAETitle = aa.env.getValue("CAETitle");137 var OLDCAEValidatedNumber = aa.env.getValue("CAEValidatedNumber");138 var OLDCAEZip = aa.env.getValue("CAEZip");139 var OLDCapCommentText = aa.env.getValue("CapCommentText");140 var OLDComplainantAddressLine1 = aa.env.getValue("ComplainantAddressLine1");141 var OLDComplainantAddressLine2 = aa.env.getValue("ComplainantAddressLine2");142 var OLDComplainantAddressLine3 = aa.env.getValue("ComplainantAddressLine3");143 var OLDComplainantBusinessName = aa.env.getValue("ComplainantBusinessName");144 var OLDComplainantCity = aa.env.getValue("ComplainantCity");145 var OLDComplainantContactType = aa.env.getValue("ComplainantContactType");146 var OLDComplainantCountry = aa.env.getValue("ComplainantCountry");147 var OLDComplainantEmail = aa.env.getValue("ComplainantEmail");148 var OLDComplainantFax = aa.env.getValue("ComplainantFax");149 var OLDComplainantFirstName = aa.env.getValue("ComplainantFirstName");150 var OLDComplainantId = aa.env.getValue("ComplainantId");151 var OLDComplainantLastName = aa.env.getValue("ComplainantLastName");152 var OLDComplainantMiddleName = aa.env.getValue("ComplainantMiddleName");153 var OLDComplainantPhone1 = aa.env.getValue("ComplainantPhone1");154 var OLDComplainantRelation = aa.env.getValue("ComplainantRelation");155 var OLDComplainantState = aa.env.getValue("ComplainantState");156 var OLDComplainantZip = aa.env.getValue("ComplainantZip");157 var OLDComplaintDate = aa.env.getValue("ComplaintDate");158 var OLDComplaintReferenceId1 = aa.env.getValue("ComplaintReferenceId1");159 var OLDComplaintReferenceId2 = aa.env.getValue("ComplaintReferenceId2");160 var OLDComplaintReferenceId3 = aa.env.getValue("ComplaintReferenceId3");161 var OLDComplaintReferenceSource = aa.env.getValue("ComplaintReferenceSource");162 var OLDComplaintReferenceType = aa.env.getValue("ComplaintReferenceType");163 var OLDContactList = aa.env.getValue("ContactList");164 var OLDCreatedByACA = aa.env.getValue("CreatedByACA");165 var OLDCurrentUserID = aa.env.getValue("CurrentUserID");166 var OLDLicProfList = aa.env.getValue("LicProfList");167 var OLDOwnerEmail = aa.env.getValue("OwnerEmail");168 var OLDOwnerFirstName = aa.env.getValue("OwnerFirstName");169 var OLDOwnerFullName = aa.env.getValue("OwnerFullName");170 var OLDOwnerLastName = aa.env.getValue("OwnerLastName");171 var OLDOwnerMailAddressLine1 = aa.env.getValue("OwnerMailAddressLine1");172 var OLDOwnerMailAddressLine2 = aa.env.getValue("OwnerMailAddressLine2");173 var OLDOwnerMailAddressLine3 = aa.env.getValue("OwnerMailAddressLine3");174 var OLDOwnerMailCity = aa.env.getValue("OwnerMailCity");175 var OLDOwnerMailState = aa.env.getValue("OwnerMailState");176 var OLDOwnerMailZip = aa.env.getValue("OwnerMailZip");177 var OLDOwnerMiddleName = aa.env.getValue("OwnerMiddleName");178 var OLDOwnerPhone = aa.env.getValue("OwnerPhone");179 var OLDOwnerPrimaryFlag = aa.env.getValue("OwnerPrimaryFlag");180 var OLDOwnerValidatedNumber = aa.env.getValue("OwnerValidatedNumber");181 var OLDParcelArea = aa.env.getValue("ParcelArea");182 var OLDParcelBlock = aa.env.getValue("ParcelBlock");183 var OLDParcelBook = aa.env.getValue("ParcelBook");184 var OLDParcelExcemptValue = aa.env.getValue("ParcelExcemptValue");185 var OLDParcelImprovedValue = aa.env.getValue("ParcelImprovedValue");186 var OLDParcelLandValue = aa.env.getValue("ParcelLandValue");187 var OLDParcelLegalDescription = aa.env.getValue("ParcelLegalDescription");188 var OLDParcelLot = aa.env.getValue("ParcelLot");189 var OLDParcelPage = aa.env.getValue("ParcelPage");190 var OLDParcelParcel = aa.env.getValue("ParcelParcel");191 var OLDParcelPrimaryFlag = aa.env.getValue("ParcelPrimaryFlag");192 var OLDParcelRange = aa.env.getValue("ParcelRange");193 var OLDParcelSection = aa.env.getValue("ParcelSection");194 var OLDParcelSubdivision = aa.env.getValue("ParcelSubdivision");195 var OLDParcelTownship = aa.env.getValue("ParcelTownship");196 var OLDParcelTract = aa.env.getValue("ParcelTract");197 var OLDParcelValidatedNumber = aa.env.getValue("ParcelValidatedNumber");198 var OLDParentCapID = aa.env.getValue("ParentCapID");199 var OLDPermitId1 = aa.env.getValue("PermitId1");200 var OLDPermitId2 = aa.env.getValue("PermitId2");201 var OLDPermitId3 = aa.env.getValue("PermitId3");202 var OLDRefAddressType = aa.env.getValue("RefAddressType");203 var OLDStructEstabScriptList = aa.env.getValue("StructEstabScriptList");204 var OLDViolationAddressLine1 = aa.env.getValue("ViolationAddressLine1");205 var OLDViolationAddressLine2 = aa.env.getValue("ViolationAddressLine2");206 var OLDViolationCity = aa.env.getValue("ViolationCity");207 var OLDViolationComment = aa.env.getValue("ViolationComment");208 var OLDViolationLocation = aa.env.getValue("ViolationLocation");209 var OLDViolationState = aa.env.getValue("ViolationState");210 var OLDViolationZip = aa.env.getValue("ViolationZip");211 capId = newCapId;212 vEventName = "ApplicationSubmitAfter";213 if (capId !== null) {214 prefix = lookup("EMSE_VARIABLE_BRANCH_PREFIX", "ApplicationSubmitAfter");215 parentCapId = pcapId;216 servProvCode = capId.getServiceProviderCode();217 capIDString = capId.getCustomID();218 cap = aa.cap.getCap(capId).getOutput();219 appTypeResult = cap.capType;220 appTypeString = appTypeResult.toString();221 appTypeArray = appTypeString.split("/");222 if (appTypeArray[0].substr(0, 1) != "_") {223 var currentUserGroupObj = aa.userright.getUserRight(appTypeArray[0], currentUserID).getOutput();224 if (currentUserGroupObj)225 currentUserGroup = currentUserGroupObj.getGroupName();226 }227 capName = cap.getSpecialText();228 capStatus = cap.getCapStatus();229 partialCap = !cap.isCompleteCap();230 fileDateObj = cap.getFileDate();231 fileDate = "" + fileDateObj.getMonth() + "/" + fileDateObj.getDayOfMonth() + "/" + fileDateObj.getYear();232 fileDateYYYYMMDD = dateFormatted(fileDateObj.getMonth(), fileDateObj.getDayOfMonth(), fileDateObj.getYear(), "YYYY-MM-DD");233 var valobj = aa.finance.getContractorSuppliedValuation(capId, null).getOutput();234 if (valobj.length) {235 estValue = valobj[0].getEstimatedValue();236 calcValue = valobj[0].getCalculatedValue();237 feeFactor = valobj[0].getbValuatn().getFeeFactorFlag();238 }239 var capDetailObjResult = aa.cap.getCapDetail(capId);240 if (capDetailObjResult.getSuccess()) {241 capDetail = capDetailObjResult.getOutput();242 houseCount = capDetail.getHouseCount();243 feesInvoicedTotal = capDetail.getTotalFee();244 balanceDue = capDetail.getBalance();245 }246 loadAppSpecific(AInfo);247 loadTaskSpecific(AInfo);248 loadParcelAttributes(AInfo);249 loadASITables();250 CreatedByACA = 'N';251 }252 doScriptActions();253 //Reset global variables to the original records254 vScriptName = pvScriptName;255 vEventName = pvEventName;256 prefix = pprefix;257 capId = pcapId;258 cap = pcap;259 capIDString = pcapIDString;260 appTypeResult = pappTypeResult;261 appTypeString = pappTypeString;262 appTypeArray = pappTypeArray;263 capName = pcapName;264 capStatus = pcapStatus;265 fileDateObj = pfileDateObj;266 fileDate = pfileDate;267 fileDateYYYYMMDD = pfileDateYYYYMMDD;268 parcelArea = pparcelArea;269 estValue = pestValue;270 feesInvoicedTotal = pfeesInvoicedTotal;271 balanceDue = pbalanceDue;272 houseCount = phouseCount;273 feesInvoicedTotal = pfeesInvoicedTotal;274 capDetail = pcapDetail;275 AInfo = pAInfo;276 partialCap = ppartialCap;277 parentCapId = pparentCapId;278 CreatedByACA = pCreatedByACA;279 //reset session variables with the old variables280 aa.env.setValue("AdditionalInfoBuildingCount", OLDAdditionalInfoBuildingCount)281 aa.env.setValue("AdditionalInfoConstructionTypeCode", OLDAdditionalInfoConstructionTypeCode)282 aa.env.setValue("AdditionalInfoHouseCount", OLDAdditionalInfoHouseCount)283 aa.env.setValue("AdditionalInfoPublicOwnedFlag", OLDAdditionalInfoPublicOwnedFlag)284 aa.env.setValue("AdditionalInfoValuation", OLDAdditionalInfoValuation)285 aa.env.setValue("AdditionalInfoWorkDescription", OLDAdditionalInfoWorkDescription)286 aa.env.setValue("AddressCity", OLDAddressCity)287 aa.env.setValue("AddressHouseFraction", OLDAddressHouseFraction)288 aa.env.setValue("AddressHouseNumber", OLDAddressHouseNumber)289 aa.env.setValue("AddressLine1", OLDAddressLine1)290 aa.env.setValue("AddressLine2", OLDAddressLine2)291 aa.env.setValue("AddressPrimaryFlag", OLDAddressPrimaryFlag)292 aa.env.setValue("AddressState", OLDAddressState)293 aa.env.setValue("AddressStreetDirection", OLDAddressStreetDirection)294 aa.env.setValue("AddressStreetName", OLDAddressStreetName)295 aa.env.setValue("AddressStreetSuffix", OLDAddressStreetSuffix)296 aa.env.setValue("AddressType", OLDAddressType)297 aa.env.setValue("AddressUnitNumber", OLDAddressUnitNumber)298 aa.env.setValue("AddressUnitType", OLDAddressUnitType)299 aa.env.setValue("AddressValidatedNumber", OLDAddressValidatedNumber)300 aa.env.setValue("AddressZip", OLDAddressZip)301 aa.env.setValue("AppDetailFirstIssuedDate", OLDAppDetailFirstIssuedDate)302 aa.env.setValue("AppDetailStatusReason", OLDAppDetailStatusReason)303 aa.env.setValue("ApplicantAddressLine1", OLDApplicantAddressLine1)304 aa.env.setValue("ApplicantAddressLine2", OLDApplicantAddressLine2)305 aa.env.setValue("ApplicantAddressLine3", OLDApplicantAddressLine3)306 aa.env.setValue("ApplicantBirthDate", OLDApplicantBirthDate)307 aa.env.setValue("ApplicantBusinessName", OLDApplicantBusinessName)308 aa.env.setValue("ApplicantCity", OLDApplicantCity)309 aa.env.setValue("ApplicantContactAddressModelList", OLDApplicantContactAddressModelList)310 aa.env.setValue("ApplicantContactType", OLDApplicantContactType)311 aa.env.setValue("ApplicantCountry", OLDApplicantCountry)312 aa.env.setValue("ApplicantEmail", OLDApplicantEmail)313 aa.env.setValue("ApplicantFaxCountryCode", OLDApplicantFaxCountryCode)314 aa.env.setValue("ApplicantFirstName", OLDApplicantFirstName)315 aa.env.setValue("ApplicantGender", OLDApplicantGender)316 aa.env.setValue("ApplicantId", OLDApplicantId)317 aa.env.setValue("ApplicantLastName", OLDApplicantLastName)318 aa.env.setValue("ApplicantMiddleName", OLDApplicantMiddleName)319 aa.env.setValue("ApplicantNamesuffix", OLDApplicantNamesuffix)320 aa.env.setValue("ApplicantPhone1", OLDApplicantPhone1)321 aa.env.setValue("ApplicantPhone1CountryCode", OLDApplicantPhone1CountryCode)322 aa.env.setValue("ApplicantPhone2", OLDApplicantPhone2)323 aa.env.setValue("ApplicantPhone2CountryCode", OLDApplicantPhone2CountryCode)324 aa.env.setValue("ApplicantPhone3", OLDApplicantPhone3)325 aa.env.setValue("ApplicantPhone3CountryCode", OLDApplicantPhone3CountryCode)326 aa.env.setValue("ApplicantPostOfficeBox", OLDApplicantPostOfficeBox)327 aa.env.setValue("ApplicantRelation", OLDApplicantRelation)328 aa.env.setValue("ApplicantSalutation", OLDApplicantSalutation)329 aa.env.setValue("ApplicantState", OLDApplicantState)330 aa.env.setValue("ApplicantZip", OLDApplicantZip)331 aa.env.setValue("ApplicationStatus", OLDApplicationStatus)332 aa.env.setValue("ApplicationSubmitMode", OLDApplicationSubmitMode)333 aa.env.setValue("ApplicationTypeLevel1", OLDApplicationTypeLevel1)334 aa.env.setValue("ApplicationTypeLevel2", OLDApplicationTypeLevel2)335 aa.env.setValue("ApplicationTypeLevel3", OLDApplicationTypeLevel3)336 aa.env.setValue("ApplicationTypeLevel4", OLDApplicationTypeLevel4)337 aa.env.setValue("CAEAddressLine1", OLDCAEAddressLine1)338 aa.env.setValue("CAEAddressLine2", OLDCAEAddressLine2)339 aa.env.setValue("CAEAddressLine3", OLDCAEAddressLine3)340 aa.env.setValue("CAEBirthDate", OLDCAEBirthDate)341 aa.env.setValue("CAEBusinessName", OLDCAEBusinessName)342 aa.env.setValue("CAEBusName2", OLDCAEBusName2)343 aa.env.setValue("CAECity", OLDCAECity)344 aa.env.setValue("CAECountry", OLDCAECountry)345 aa.env.setValue("CAECountryCode", OLDCAECountryCode)346 aa.env.setValue("CAEEmail", OLDCAEEmail)347 aa.env.setValue("CAEFirstName", OLDCAEFirstName)348 aa.env.setValue("CAEGender", OLDCAEGender)349 aa.env.setValue("CAELastName", OLDCAELastName)350 aa.env.setValue("CAELienseNumber", OLDCAELienseNumber)351 aa.env.setValue("CAELienseType", OLDCAELienseType)352 aa.env.setValue("CAEMiddleName", OLDCAEMiddleName)353 aa.env.setValue("CAEPhone1", OLDCAEPhone1)354 aa.env.setValue("CAEPhone2", OLDCAEPhone2)355 aa.env.setValue("CAEPhone2CountryCode", OLDCAEPhone2CountryCode)356 aa.env.setValue("CAEPhone3", OLDCAEPhone3)357 aa.env.setValue("CAEPhone3CountryCode", OLDCAEPhone3CountryCode)358 aa.env.setValue("CAEPostOfficeBox", OLDCAEPostOfficeBox)359 aa.env.setValue("CAESalutation", OLDCAESalutation)360 aa.env.setValue("CAEState", OLDCAEState)361 aa.env.setValue("CAESuffixName", OLDCAESuffixName)362 aa.env.setValue("CAETitle", OLDCAETitle)363 aa.env.setValue("CAEValidatedNumber", OLDCAEValidatedNumber)364 aa.env.setValue("CAEZip", OLDCAEZip)365 aa.env.setValue("CapCommentText", OLDCapCommentText)366 aa.env.setValue("ComplainantAddressLine1", OLDComplainantAddressLine1)367 aa.env.setValue("ComplainantAddressLine2", OLDComplainantAddressLine2)368 aa.env.setValue("ComplainantAddressLine3", OLDComplainantAddressLine3)369 aa.env.setValue("ComplainantBusinessName", OLDComplainantBusinessName)370 aa.env.setValue("ComplainantCity", OLDComplainantCity)371 aa.env.setValue("ComplainantContactType", OLDComplainantContactType)372 aa.env.setValue("ComplainantCountry", OLDComplainantCountry)373 aa.env.setValue("ComplainantEmail", OLDComplainantEmail)374 aa.env.setValue("ComplainantFax", OLDComplainantFax)375 aa.env.setValue("ComplainantFirstName", OLDComplainantFirstName)376 aa.env.setValue("ComplainantId", OLDComplainantId)377 aa.env.setValue("ComplainantLastName", OLDComplainantLastName)378 aa.env.setValue("ComplainantMiddleName", OLDComplainantMiddleName)379 aa.env.setValue("ComplainantPhone1", OLDComplainantPhone1)380 aa.env.setValue("ComplainantRelation", OLDComplainantRelation)381 aa.env.setValue("ComplainantState", OLDComplainantState)382 aa.env.setValue("ComplainantZip", OLDComplainantZip)383 aa.env.setValue("ComplaintDate", OLDComplaintDate)384 aa.env.setValue("ComplaintReferenceId1", OLDComplaintReferenceId1)385 aa.env.setValue("ComplaintReferenceId2", OLDComplaintReferenceId2)386 aa.env.setValue("ComplaintReferenceId3", OLDComplaintReferenceId3)387 aa.env.setValue("ComplaintReferenceSource", OLDComplaintReferenceSource)388 aa.env.setValue("ComplaintReferenceType", OLDComplaintReferenceType)389 aa.env.setValue("ContactList", OLDContactList)390 aa.env.setValue("CreatedByACA", OLDCreatedByACA)391 aa.env.setValue("CurrentUserID", OLDCurrentUserID)392 aa.env.setValue("LicProfList", OLDLicProfList)393 aa.env.setValue("OwnerEmail", OLDOwnerEmail)394 aa.env.setValue("OwnerFirstName", OLDOwnerFirstName)395 aa.env.setValue("OwnerFullName", OLDOwnerFullName)396 aa.env.setValue("OwnerLastName", OLDOwnerLastName)397 aa.env.setValue("OwnerMailAddressLine1", OLDOwnerMailAddressLine1)398 aa.env.setValue("OwnerMailAddressLine2", OLDOwnerMailAddressLine2)399 aa.env.setValue("OwnerMailAddressLine3", OLDOwnerMailAddressLine3)400 aa.env.setValue("OwnerMailCity", OLDOwnerMailCity)401 aa.env.setValue("OwnerMailState", OLDOwnerMailState)402 aa.env.setValue("OwnerMailZip", OLDOwnerMailZip)403 aa.env.setValue("OwnerMiddleName", OLDOwnerMiddleName)404 aa.env.setValue("OwnerPhone", OLDOwnerPhone)405 aa.env.setValue("OwnerPrimaryFlag", OLDOwnerPrimaryFlag)406 aa.env.setValue("OwnerValidatedNumber", OLDOwnerValidatedNumber)407 aa.env.setValue("ParcelArea", OLDParcelArea)408 aa.env.setValue("ParcelBlock", OLDParcelBlock)409 aa.env.setValue("ParcelBook", OLDParcelBook)410 aa.env.setValue("ParcelExcemptValue", OLDParcelExcemptValue)411 aa.env.setValue("ParcelImprovedValue", OLDParcelImprovedValue)412 aa.env.setValue("ParcelLandValue", OLDParcelLandValue)413 aa.env.setValue("ParcelLegalDescription", OLDParcelLegalDescription)414 aa.env.setValue("ParcelLot", OLDParcelLot)415 aa.env.setValue("ParcelPage", OLDParcelPage)416 aa.env.setValue("ParcelParcel", OLDParcelParcel)417 aa.env.setValue("ParcelPrimaryFlag", OLDParcelPrimaryFlag)418 aa.env.setValue("ParcelRange", OLDParcelRange)419 aa.env.setValue("ParcelSection", OLDParcelSection)420 aa.env.setValue("ParcelSubdivision", OLDParcelSubdivision)421 aa.env.setValue("ParcelTownship", OLDParcelTownship)422 aa.env.setValue("ParcelTract", OLDParcelTract)423 aa.env.setValue("ParcelValidatedNumber", OLDParcelValidatedNumber)424 aa.env.setValue("ParentCapID", OLDParentCapID)425 aa.env.setValue("PermitId1", OLDPermitId1)426 aa.env.setValue("PermitId2", OLDPermitId2)427 aa.env.setValue("PermitId3", OLDPermitId3)428 aa.env.setValue("RefAddressType", OLDRefAddressType)429 aa.env.setValue("StructEstabScriptList", OLDStructEstabScriptList)430 aa.env.setValue("ViolationAddressLine1", OLDViolationAddressLine1)431 aa.env.setValue("ViolationAddressLine2", OLDViolationAddressLine2)432 aa.env.setValue("ViolationCity", OLDViolationCity)433 aa.env.setValue("ViolationComment", OLDViolationComment)434 aa.env.setValue("ViolationLocation", OLDViolationLocation)435 aa.env.setValue("ViolationState", OLDViolationState)436 aa.env.setValue("ViolationZip", OLDViolationZip)...
letterDictionary.js
Source:letterDictionary.js
1class LetterDictionary {2 constructor(lang) {3 this._map = {};4 this.setValue("nl", "A", 1);5 this.setValue("nl", "B", 3);6 this.setValue("nl", "C", 5);7 this.setValue("nl", "D", 2);8 this.setValue("nl", "E", 1);9 this.setValue("nl", "F", 4);10 this.setValue("nl", "G", 3);11 this.setValue("nl", "H", 4);12 this.setValue("nl", "I", 1);13 this.setValue("nl", "J", 4);14 this.setValue("nl", "K", 3);15 this.setValue("nl", "L", 3);16 this.setValue("nl", "M", 3);17 this.setValue("nl", "N", 1);18 this.setValue("nl", "O", 1);19 this.setValue("nl", "P", 3);20 this.setValue("nl", "Q", 10);21 this.setValue("nl", "R", 2);22 this.setValue("nl", "S", 2);23 this.setValue("nl", "T", 2);24 this.setValue("nl", "U", 4);25 this.setValue("nl", "V", 4);26 this.setValue("nl", "W", 5);27 this.setValue("nl", "X", 8);28 this.setValue("nl", "Y", 8);29 this.setValue("nl", "Z", 4);30 this.setValue("nl", this.wildCard, 0);31 //en - English32 this.setValue("en", "A", 1);33 this.setValue("en", "B", 3);34 this.setValue("en", "C", 3);35 this.setValue("en", "D", 2);36 this.setValue("en", "E", 1);37 this.setValue("en", "F", 4);38 this.setValue("en", "G", 2);39 this.setValue("en", "H", 4);40 this.setValue("en", "I", 1);41 this.setValue("en", "J", 8);42 this.setValue("en", "K", 5);43 this.setValue("en", "L", 1);44 this.setValue("en", "M", 3);45 this.setValue("en", "N", 1);46 this.setValue("en", "O", 1);47 this.setValue("en", "P", 3);48 this.setValue("en", "Q", 10);49 this.setValue("en", "R", 1);50 this.setValue("en", "S", 1);51 this.setValue("en", "T", 1);52 this.setValue("en", "U", 1);53 this.setValue("en", "V", 4);54 this.setValue("en", "W", 4);55 this.setValue("en", "X", 8);56 this.setValue("en", "Y", 4);57 this.setValue("en", "Z", 10);58 this.setValue("en", this.wildCard, 0);59 //de - German60 this.setValue("de", "A", 1);61 this.setValue("de", "Ã", 6);62 this.setValue("de", "B", 3);63 this.setValue("de", "C", 4);64 this.setValue("de", "D", 1);65 this.setValue("de", "E", 1);66 this.setValue("de", "F", 4);67 this.setValue("de", "G", 2);68 this.setValue("de", "H", 2);69 this.setValue("de", "I", 1);70 this.setValue("de", "J", 6);71 this.setValue("de", "K", 4);72 this.setValue("de", "L", 2);73 this.setValue("de", "M", 3);74 this.setValue("de", "N", 1);75 this.setValue("de", "O", 2);76 this.setValue("de", "Ã", 8);77 this.setValue("de", "P", 4);78 this.setValue("de", "Q", 10);79 this.setValue("de", "R", 1);80 this.setValue("de", "S", 1);81 this.setValue("de", "T", 1);82 this.setValue("de", "U", 1);83 this.setValue("de", "Ã", 6);84 this.setValue("de", "V", 6);85 this.setValue("de", "W", 3);86 this.setValue("de", "X", 8);87 this.setValue("de", "Y", 10);88 this.setValue("de", "Z", 3);89 this.setValue("de", this.wildCard, 0);90 //fr - French91 this.setValue("fr", "A", 1);92 this.setValue("fr", "B", 3);93 this.setValue("fr", "C", 3);94 this.setValue("fr", "D", 2);95 this.setValue("fr", "E", 1);96 this.setValue("fr", "F", 4);97 this.setValue("fr", "G", 2);98 this.setValue("fr", "H", 4);99 this.setValue("fr", "I", 1);100 this.setValue("fr", "J", 8);101 this.setValue("fr", "K", 10);102 this.setValue("fr", "L", 1);103 this.setValue("fr", "M", 2);104 this.setValue("fr", "N", 1);105 this.setValue("fr", "O", 1);106 this.setValue("fr", "P", 3);107 this.setValue("fr", "Q", 8);108 this.setValue("fr", "R", 1);109 this.setValue("fr", "S", 1);110 this.setValue("fr", "T", 1);111 this.setValue("fr", "U", 1);112 this.setValue("fr", "V", 4);113 this.setValue("fr", "W", 10);114 this.setValue("fr", "X", 10);115 this.setValue("fr", "Y", 10);116 this.setValue("fr", "Z", 10);117 this.setValue("fr", this.wildCard, 0);118 //es - Spanish119 this.setValue("es", "A", 1);120 this.setValue("es", "B", 3);121 this.setValue("es", "C", 3);122 this.setValue("es", "CH", 5);123 this.setValue("es", "D", 2);124 this.setValue("es", "E", 1);125 this.setValue("es", "F", 4);126 this.setValue("es", "G", 2);127 this.setValue("es", "H", 4);128 this.setValue("es", "I", 1);129 this.setValue("es", "J", 8);130 this.setValue("es", "L", 1);131 this.setValue("es", "LL", 8);132 this.setValue("es", "M", 3);133 this.setValue("es", "N", 1);134 this.setValue("es", "Ã", 8);135 this.setValue("es", "O", 1);136 this.setValue("es", "P", 3);137 this.setValue("es", "Q", 5);138 this.setValue("es", "R", 1);139 this.setValue("es", "RR", 8);140 this.setValue("es", "S", 1);141 this.setValue("es", "T", 1);142 this.setValue("es", "U", 1);143 this.setValue("es", "V", 4);144 this.setValue("es", "X", 8);145 this.setValue("es", "Y", 4);146 this.setValue("es", "Z", 10);147 this.setValue("es", this.wildCard, 0);148 //it - Italian149 this.setValue("it", "A", 1);150 this.setValue("it", "B", 5);151 this.setValue("it", "C", 2);152 this.setValue("it", "D", 5);153 this.setValue("it", "E", 1);154 this.setValue("it", "F", 5);155 this.setValue("it", "G", 8);156 this.setValue("it", "H", 8);157 this.setValue("it", "I", 1);158 this.setValue("it", "L", 3);159 this.setValue("it", "M", 3);160 this.setValue("it", "N", 3);161 this.setValue("it", "O", 1);162 this.setValue("it", "P", 5);163 this.setValue("it", "Q", 10);164 this.setValue("it", "R", 2);165 this.setValue("it", "S", 2);166 this.setValue("it", "T", 2);167 this.setValue("it", "U", 3);168 this.setValue("it", "V", 5);169 this.setValue("it", "Z", 8);170 this.setValue("it", this.wildCard, 0);171 //sv - Swedish172 this.setValue("sv", "A", 1);173 this.setValue("sv", "Ã
", 4);174 this.setValue("sv", "Ã", 3);175 this.setValue("sv", "B", 4);176 this.setValue("sv", "C", 8);177 this.setValue("sv", "D", 1);178 this.setValue("sv", "E", 1);179 this.setValue("sv", "F", 3);180 this.setValue("sv", "G", 2);181 this.setValue("sv", "H", 2);182 this.setValue("sv", "I", 1);183 this.setValue("sv", "J", 5);184 this.setValue("sv", "K", 2);185 this.setValue("sv", "L", 1);186 this.setValue("sv", "M", 2);187 this.setValue("sv", "N", 1);188 this.setValue("sv", "O", 2);189 this.setValue("sv", "Ã", 4);190 this.setValue("sv", "P", 4);191 this.setValue("sv", "Q", 0);192 this.setValue("sv", "R", 1);193 this.setValue("sv", "S", 1);194 this.setValue("sv", "T", 1);195 this.setValue("sv", "U", 3);196 this.setValue("sv", "Ã", 0);197 this.setValue("sv", "V", 3);198 this.setValue("sv", "W", 0);199 this.setValue("sv", "X", 8);200 this.setValue("sv", "Y", 7);201 this.setValue("sv", "Z", 8);202 this.setValue("sv", this.wildCard, 0);203 //dk - Danish204 this.setValue("dk", "A", 1);205 this.setValue("dk", "Ã
", 4);206 this.setValue("dk", "B", 3);207 this.setValue("dk", "C", 8);208 this.setValue("dk", "D", 2);209 this.setValue("dk", "E", 1);210 this.setValue("dk", "Ã", 4);211 this.setValue("dk", "F", 3);212 this.setValue("dk", "G", 3);213 this.setValue("dk", "H", 4);214 this.setValue("dk", "I", 3);215 this.setValue("dk", "J", 4);216 this.setValue("dk", "K", 3);217 this.setValue("dk", "L", 2);218 this.setValue("dk", "M", 3);219 this.setValue("dk", "N", 1);220 this.setValue("dk", "O", 2);221 this.setValue("dk", "Ã", 4);222 this.setValue("dk", "P", 4);223 this.setValue("dk", "Q", 0);224 this.setValue("dk", "R", 1);225 this.setValue("dk", "S", 2);226 this.setValue("dk", "T", 2);227 this.setValue("dk", "U", 3);228 this.setValue("dk", "Ã", 0);229 this.setValue("dk", "V", 3);230 this.setValue("dk", "W", 0);231 this.setValue("dk", "X", 8);232 this.setValue("dk", "Y", 4);233 this.setValue("dk", "Z", 8);234 this.setValue("dk", this.wildCard, 0);235 //no - Norwegian236 this.setValue("no", "A", 1);237 this.setValue("no", "Ã
", 4);238 this.setValue("no", "B", 4);239 this.setValue("no", "C", 10);240 this.setValue("no", "D", 1);241 this.setValue("no", "E", 1);242 this.setValue("no", "Ã", 6);243 this.setValue("no", "F", 2);244 this.setValue("no", "G", 2);245 this.setValue("no", "H", 3);246 this.setValue("no", "I", 1);247 this.setValue("no", "J", 4);248 this.setValue("no", "K", 2);249 this.setValue("no", "L", 1);250 this.setValue("no", "M", 2);251 this.setValue("no", "N", 1);252 this.setValue("no", "O", 2);253 this.setValue("no", "Ã", 5);254 this.setValue("no", "P", 4);255 this.setValue("no", "Q", 0);256 this.setValue("no", "R", 1);257 this.setValue("no", "S", 2);258 this.setValue("no", "T", 1);259 this.setValue("no", "U", 4);260 this.setValue("no", "Ã", 0);261 this.setValue("no", "V", 4);262 this.setValue("no", "W", 8);263 this.setValue("no", "X", 0);264 this.setValue("no", "Y", 6);265 this.setValue("no", "Z", 0);266 this.setValue("no", this.wildCard, 0);267 //cs - Czech268 this.setValue("cs", "A", 1);269 this.setValue("cs", "Ã", 2);270 this.setValue("cs", "B", 3);271 this.setValue("cs", "C", 2);272 this.setValue("cs", "Ä", 4);273 this.setValue("cs", "D", 1);274 this.setValue("cs", "Ä", 8);275 this.setValue("cs", "E", 1);276 this.setValue("cs", "Ã", 3);277 this.setValue("cs", "Ä", 3);278 this.setValue("cs", "F", 5);279 this.setValue("cs", "G", 5);280 this.setValue("cs", "H", 2);281 this.setValue("cs", "I", 1);282 this.setValue("cs", "Ã", 2);283 this.setValue("cs", "J", 2);284 this.setValue("cs", "K", 1);285 this.setValue("cs", "L", 1);286 this.setValue("cs", "M", 2);287 this.setValue("cs", "N", 1);288 this.setValue("cs", "Å", 6);289 this.setValue("cs", "O", 1);290 this.setValue("cs", "Ã", 7);291 this.setValue("cs", "P", 1);292 this.setValue("cs", "R", 1);293 this.setValue("cs", "Å", 4);294 this.setValue("cs", "S", 1);295 this.setValue("cs", "Å ", 4);296 this.setValue("cs", "T", 1);297 this.setValue("cs", "Ť", 7);298 this.setValue("cs", "U", 2);299 this.setValue("cs", "Å®", 4);300 this.setValue("cs", "Ã", 5);301 this.setValue("cs", "V", 1);302 this.setValue("cs", "X", 10);303 this.setValue("cs", "Y", 2);304 this.setValue("cs", "Ã", 4);305 this.setValue("cs", "Z", 2);306 this.setValue("cs", "Ž", 4);307 this.setValue("cs", this.wildCard, 0);308 //tr - Turkish309 this.setValue("tr", "A", 1);310 this.setValue("tr", "E", 1);311 this.setValue("tr", "Ä°", 1);312 this.setValue("tr", "K", 1);313 this.setValue("tr", "L", 1);314 this.setValue("tr", "R", 1);315 this.setValue("tr", "N", 1);316 this.setValue("tr", "T", 1);317 this.setValue("tr", "I", 2);318 this.setValue("tr", "M", 2);319 this.setValue("tr", "O", 2);320 this.setValue("tr", "S", 2);321 this.setValue("tr", "U", 2);322 this.setValue("tr", "B", 3);323 this.setValue("tr", "D", 3);324 this.setValue("tr", "Y", 3);325 this.setValue("tr", "Ã", 3);326 this.setValue("tr", "C", 4);327 this.setValue("tr", "Å", 4);328 this.setValue("tr", "Z", 4);329 this.setValue("tr", "Ã", 4);330 this.setValue("tr", "H", 5);331 this.setValue("tr", "P", 5);332 this.setValue("tr", "G", 5);333 this.setValue("tr", "F", 7);334 this.setValue("tr", "V", 7);335 this.setValue("tr", "Ã", 7);336 this.setValue("tr", "Ä", 8);337 this.setValue("tr", "J", 10);338 this.setValue("tr", this.wildCard, 0);339 this.setLang(lang || 'nl');340 }341 setValue(lang, symbol, value) {342 if (typeof(this._map[lang]) === 'undefined') {343 this._map[lang] = {}344 }345 this._map[lang][symbol] = value;346 }347 setLang(lang) {348 this._lang = lang;349 }350 get symbols() {351 var symbols = Object.keys(this._map[this._lang]);352 symbols.pop(); //remove the wildcard353 return symbols;354 }355 get values() {356 var values = Object.keys(this._map[this._lang]).map(key => this._map[this._lang][key]);357 values.pop(); //remove the wildcard358 return values;359 }360 get wildCard() {361 return "#";362 }363 getIndices(symbols) {364 var indices = [];365 var self = this;366 symbols.forEach((symbol) => {367 indices.push(self.symbols.indexOf(symbol));368 });369 return indices;370 }371}...
editar-propiedades.component.ts
Source:editar-propiedades.component.ts
1import { Component, OnInit } from '@angular/core';2import { Router, ActivatedRoute, Params } from '@angular/router';3import { PropiedadService } from '../../../../services/propiedad.service';4import { Owned } from '../../../../models/owned';5import { GLOBAL } from '../../../../services/global';6import { FormGroup, FormControl, FormBuilder, Validators } from '@angular/forms';7@Component({8 selector: 'app-editar-propiedades',9 templateUrl: './administrar-propiedades.component.html',10 styleUrls: ['./administrar-propiedades.component.scss'],11 providers: [PropiedadService]12})13export class EditarPropiedadesComponent {14 public propiedad: Owned;15 public data: any;16 public filesToUpload: any = [];17 //public previsualizacion:string;18 get nombreNoValido() {19 return this.propertyForm.get("nombre").invalid && this.propertyForm.get("nombre").touched;20 }21 get personasNoValido() {22 return this.propertyForm.get("personas").invalid && this.propertyForm.get("personas").touched;23 }24 get tarifaNoValido() {25 return this.propertyForm.get("tarifa").invalid && this.propertyForm.get("tarifa").touched;26 }27 get direccionNoValido() {28 return this.propertyForm.get("tipo_propiedad").invalid && this.propertyForm.get("tipo_propiedad").touched;29 }30 get ciudadNoValido() {31 return this.propertyForm.get("ciudad").invalid && this.propertyForm.get("ciudad").touched;32 }33 get telefonoNoValido() {34 return this.propertyForm.get("telefono").invalid && this.propertyForm.get("telefono").touched;35 }36 propertyForm = new FormGroup({37 nombre: new FormControl('', [Validators.required, Validators.pattern("^[a-zA-ZñÃ]{3,50}$")]),38 descripcion: new FormControl(''),39 personas: new FormControl('', [Validators.required, Validators.pattern("^[0-9]{1,50}$")]),40 access: new FormControl(false),41 salas_reuniones: new FormControl(false),42 reception: new FormControl(false),43 eventos_network: new FormControl(false),44 terraza: new FormControl(false),45 cafe_relax: new FormControl(false),46 seguridad: new FormControl(false),47 limpieza: new FormControl(false),48 cer_energetica: new FormControl(false),49 paqueteria: new FormControl(false),50 parking: new FormControl(false),51 wifi: new FormControl(false),52 coworking: new FormControl(false),53 tarifa: new FormControl('', [Validators.required, Validators.pattern("^[0-9]{1,50}$")]),54 tipo_propiedad: new FormControl(''),55 direccion: new FormControl('', [Validators.required, Validators.pattern("^[a-zA-ZñÃ]{3,70}$")]),56 ciudad: new FormControl('', [Validators.required, Validators.pattern("^[a-zA-ZñÃ]{3,50}$")]),57 comunidad_autonoma: new FormControl(''),58 telefono: new FormControl('', [Validators.required, Validators.pattern("^[0-9]{9}$")]),59 });60 constructor(private _route: ActivatedRoute, private _router: Router, private _propiedadService: PropiedadService, private fb: FormBuilder) {61 }62 recogerDato() {63 this._route.params.forEach((params: Params) => {64 let id = params['id'];65 this._propiedadService.getPropiedad(id).subscribe(66 response => {67 this.propiedad = response;68 for (let i in this.propiedad) {69 this.propertyForm.get('nombre').setValue(this.propiedad[i].nombre);70 this.propertyForm.get('descripcion').setValue(this.propiedad[i].descripcion);71 this.propertyForm.get('personas').setValue(this.propiedad[i].personas);72 if (this.propiedad[i].access == "true") {73 this.propertyForm.get('access').setValue(true);74 } else {75 this.propertyForm.get('access').setValue(false);76 }77 if (this.propiedad[i].salas_reuniones == "true") {78 this.propertyForm.get('salas_reuniones').setValue(true);79 } else {80 this.propertyForm.get('salas_reuniones').setValue(false);81 }82 if (this.propiedad[i].reception == "true") {83 this.propertyForm.get('reception').setValue(true);84 } else {85 this.propertyForm.get('reception').setValue(false);86 }87 if (this.propiedad[i].eventos_network == "true") {88 this.propertyForm.get('eventos_network').setValue(true);89 } else {90 this.propertyForm.get('eventos_network').setValue(false);91 }92 if (this.propiedad[i].terraza == "true") {93 this.propertyForm.get('terraza').setValue(true);94 } else {95 this.propertyForm.get('terraza').setValue(false);96 }97 if (this.propiedad[i].cafe_relax == "true") {98 this.propertyForm.get('cafe_relax').setValue(true);99 } else {100 this.propertyForm.get('cafe_relax').setValue(false);101 }102 if (this.propiedad[i].seguridad == "true") {103 this.propertyForm.get('seguridad').setValue(true);104 } else {105 this.propertyForm.get('seguridad').setValue(false);106 }107 if (this.propiedad[i].limpieza == "true") {108 this.propertyForm.get('limpieza').setValue(true);109 } else {110 this.propertyForm.get('limpieza').setValue(false);111 }112 if (this.propiedad[i].cer_energetica == "true") {113 this.propertyForm.get('cer_energetica').setValue(true);114 } else {115 this.propertyForm.get('cer_energetica').setValue(false);116 }117 if (this.propiedad[i].paqueteria == "true") {118 this.propertyForm.get('paqueteria').setValue(true);119 } else {120 this.propertyForm.get('paqueteria').setValue(false);121 }122 if (this.propiedad[i].parking == "true") {123 this.propertyForm.get('parking').setValue(true);124 } else {125 this.propertyForm.get('parking').setValue(false);126 }127 if (this.propiedad[i].wifi == "true") {128 this.propertyForm.get('wifi').setValue(true);129 } else {130 this.propertyForm.get('wifi').setValue(false);131 }132 if (this.propiedad[i].coworking == "true") {133 this.propertyForm.get('coworking').setValue(true);134 } else {135 this.propertyForm.get('coworking').setValue(false);136 }137 this.propertyForm.get('tarifa').setValue(this.propiedad[i].tarifa);138 this.propertyForm.get('tipo_propiedad').setValue(this.propiedad[i].tipo_propiedad);139 this.propertyForm.get('direccion').setValue(this.propiedad[i].direccion);140 this.propertyForm.get('ciudad').setValue(this.propiedad[i].ciudad);141 this.propertyForm.get('comunidad_autonoma').setValue(this.propiedad[i].comunidad_autonoma);142 this.propertyForm.get('telefono').setValue(this.propiedad[i].telefono);143 }144 }, error => {145 console.log(<any>error);146 }147 );148 });149 }150 onSubmit() {151 this._route.params.forEach((params: Params) => {152 let id = params['id'];153 if (this.propertyForm.get('access').value == true) {154 this.propertyForm.get('access').setValue("true");155 } else {156 this.propertyForm.get('access').setValue("false");157 }158 if (this.propertyForm.get('salas_reuniones').value == true) {159 this.propertyForm.get('salas_reuniones').setValue("true");160 } else {161 this.propertyForm.get('salas_reuniones').setValue("false");162 }163 if (this.propertyForm.get('reception').value == true) {164 this.propertyForm.get('reception').setValue("true");165 } else {166 this.propertyForm.get('reception').setValue("false");167 }168 if (this.propertyForm.get('eventos_network').value == true) {169 this.propertyForm.get('eventos_network').setValue("true");170 } else {171 this.propertyForm.get('eventos_network').setValue("false");172 }173 if (this.propertyForm.get('terraza').value == true) {174 this.propertyForm.get('terraza').setValue("true");175 } else {176 this.propertyForm.get('terraza').setValue("false");177 }178 if (this.propertyForm.get('cafe_relax').value == true) {179 this.propertyForm.get('cafe_relax').setValue("true");180 } else {181 this.propertyForm.get('cafe_relax').setValue("false");182 }183 if (this.propertyForm.get('seguridad').value == true) {184 this.propertyForm.get('seguridad').setValue("true");185 } else {186 this.propertyForm.get('seguridad').setValue("false");187 }188 if (this.propertyForm.get('limpieza').value == true) {189 this.propertyForm.get('limpieza').setValue("true");190 } else {191 this.propertyForm.get('limpieza').setValue("false");192 }193 if (this.propertyForm.get('cer_energetica').value == true) {194 this.propertyForm.get('cer_energetica').setValue("true");195 } else {196 this.propertyForm.get('cer_energetica').setValue("false");197 }198 if (this.propertyForm.get('paqueteria').value == true) {199 this.propertyForm.get('paqueteria').setValue("true");200 } else {201 this.propertyForm.get('paqueteria').setValue("false");202 }203 if (this.propertyForm.get('parking').value == true) {204 this.propertyForm.get('parking').setValue("true");205 } else {206 this.propertyForm.get('parking').setValue("false");207 }208 if (this.propertyForm.get('wifi').value == true) {209 this.propertyForm.get('wifi').setValue("true");210 } else {211 this.propertyForm.get('wifi').setValue("false");212 }213 if (this.propertyForm.get('coworking').value == true) {214 this.propertyForm.get('coworking').setValue("true");215 } else {216 this.propertyForm.get('coworking').setValue("false");217 }218 this._propiedadService.editPropiedad(id, this.propertyForm.value).subscribe(219 result => {220 this._router.navigate(['/dashboard/listPropertys']);221 },222 error => {223 console.log(<any>error);224 }225 );226 });227 }228 fileChangeEvent(fileInput: any) {229 this.filesToUpload = <File>fileInput.target.files[0];230 }231 ngOnInit() {232 this.recogerDato();233 }...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!