{"id":54167,"date":"2019-12-19T00:00:00","date_gmt":"2019-12-18T21:00:00","guid":{"rendered":"https:\/\/prohoster.info\/blog\/blog_prohoster\/testmace-bystryj-start"},"modified":"2020-02-18T14:02:08","modified_gmt":"2020-02-18T11:02:08","slug":"testmace-bystryj-start","status":"publish","type":"post","link":"https:\/\/prohoster.info\/sq\/blog\/news\/testmace-bystryj-start","title":{"rendered":"TestMace. Nisje e shpejt\u00eb","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p><img decoding=\"async\" alt=\"TestMace. Nisje e shpejt\u00eb\" src=\"\/wp-content\/uploads\/2019\/12\/ca19545f1cc06814a69a6a3e6d9f3a5a.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<p>P\u00ebrsh\u00ebndetje t\u00eb gjith\u00ebve. Ne po dalim ngadal\u00eb nga hija dhe vazhdojm\u00eb serin\u00eb e artikujve rreth produktit ton\u00eb. Pas <noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/458372\/\">artikullit t\u00eb m\u00ebparsh\u00ebm<\/a><\/noindex> ne mor\u00ebm shum\u00eb komente (n\u00eb shumic\u00ebn e rasteve pozitive), propozime dhe raporte p\u00ebr bug. Sot do t'ju tregojm\u00eb <noindex><a rel=\"nofollow\" href=\"https:\/\/client.testmace.com\">TestMace<\/a><\/noindex> n\u00eb veprim dhe do t\u00eb keni mund\u00ebsi t\u00eb vler\u00ebsoni disa nga karakteristikat e aplikacionit ton\u00eb. P\u00ebr nj\u00eb zhytje m\u00eb t\u00eb plot\u00eb, ju rekomandojm\u00eb t\u00eb konsultoheni me dokumentacionin ton\u00eb n\u00eb adres\u00ebn <noindex><a rel=\"nofollow\" href=\"http:\/\/docs-ru.testmace.com\">http:\/\/docs-ru.testmace.com<\/a><\/noindex>. Pra, le t\u00eb fillojm\u00eb! <\/p>\n<p><noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><\/p>\n<h1 id=\"ustanovka\">Instalimi<\/h1>\n<p><\/p>\n<p>T\u00eb fillojm\u00eb me di\u00e7ka t\u00eb zakonshme. Aplikacioni \u00ebsht\u00eb n\u00eb dispozicion dhe v\u00ebrtet mund t\u00eb testohet n\u00eb tre platforma \u2014 Linux, Windows, MacOS. Mund t\u00eb shkarkoni instaluesin p\u00ebr sistemin operativ q\u00eb ju intereson nga <noindex><a rel=\"nofollow\" href=\"https:\/\/client.testmace.com\">faqja jon\u00eb<\/a><\/noindex>. P\u00ebr ata q\u00eb p\u00ebrdorin Linux, ka mund\u00ebsin\u00eb e instalimit <noindex><a rel=\"nofollow\" href=\"https:\/\/snapcraft.io\/testmace\">t\u00eb paket\u00ebs snap<\/a><\/noindex>. Shpresojm\u00eb shum\u00eb q\u00eb s\u00eb shpejti do t\u00eb arrijm\u00eb edhe n\u00eb Microsoft Store dhe App Store (a ka nevoj\u00eb? Si mendoni?).<\/p>\n<p><\/p>\n<h1 id=\"podopytnyy-scenariy\">Skenari i testit<\/h1>\n<p><\/p>\n<p>Si subjekt t\u00eb testimit, ne kemi zgjedhur skenarin standard n\u00eb vijim:<\/p>\n<p><\/p>\n<ul>\n<li>do t\u00eb hyjm\u00eb: p\u00ebrdoruesi \u2014 admin, fjal\u00ebkalimi \u2014 password<\/li>\n<li>do t\u00eb shtojm\u00eb nj\u00eb regjistrim t\u00eb ri<\/li>\n<li>do t\u00eb verifikojm\u00eb shtimin e sakt\u00eb t\u00eb regjistrimit<\/li>\n<\/ul>\n<p><\/p>\n<p>Do ta testojm\u00eb n\u00eb <noindex><a rel=\"nofollow\" href=\"https:\/\/testmace-quick-start.herokuapp.com\/\">https:\/\/testmace-quick-start.herokuapp.com\/<\/a><\/noindex>. Ky \u00ebsht\u00eb nj\u00eb <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/typicode\/json-server\">json-server<\/a><\/noindex>, i p\u00ebrshtatsh\u00ebm p\u00ebr testimin e aplikacioneve t\u00eb tilla. Ne thjesht shtuam autorizimin me token n\u00eb t\u00eb gjitha rrug\u00ebt e json-server dhe krijuam metod\u00ebn login p\u00ebr t\u00eb marr\u00eb k\u00ebt\u00eb token. Do t\u00eb avancojm\u00eb hapat hap pas hapi, duke p\u00ebrmir\u00ebsuar gradualisht projektin ton\u00eb.<\/p>\n<p><\/p>\n<h2 id=\"sozdanie-proekta-i-popytka-sozdat-suschnost-bez-avtorizacii\">Krijimi i projektit dhe p\u00ebrpjekja p\u00ebr t\u00eb krijuar nj\u00eb entitet pa autorizim<\/h2>\n<p><\/p>\n<p>S\u00eb pari, do t\u00eb krijojm\u00eb nj\u00eb projekt t\u00eb ri (<strong>Skedari<\/strong>-&gt;<strong>Projekti i ri<\/strong>). N\u00ebse po e aktivizoni aplikacionin p\u00ebr her\u00eb t\u00eb par\u00eb, projekti i ri do t\u00eb hapet automatikisht. S\u00eb pari, le t\u00eb p\u00ebrpiqemi t\u00eb b\u00ebjm\u00eb nj\u00eb k\u00ebrkes\u00eb p\u00ebr krijimin e nj\u00eb regjistrimi t\u00eb ri (ndoshta krijimi i regjistrimeve \u00ebsht\u00eb i disponuesh\u00ebm pa autorizim). Zgjidhni nga menuja kontekstuale t\u00eb nodit Projekt opsionet <strong>Shto nod<\/strong> -&gt; <strong>RequestStep<\/strong>. Si em\u00ebr t\u00eb nodit, le t\u00eb caktojm\u00eb <strong>create-post<\/strong>. Si rezultat, nj\u00eb nod i ri do t\u00eb krijohet n\u00eb pem\u00eb dhe do t\u00eb hapet skeda e k\u00ebtij nodi. Le t\u00eb vendosim parametrat e m\u00ebposht\u00ebm t\u00eb k\u00ebrkes\u00ebs:<\/p>\n<p><\/p>\n<ul>\n<li>Lloji i k\u00ebrkes\u00ebs: POST<\/li>\n<li>url: <noindex><a rel=\"nofollow\" href=\"https:\/\/testmace-quick-start.herokuapp.com\/posts\">https:\/\/testmace-quick-start.herokuapp.com\/posts<\/a><\/noindex><\/li>\n<li>Trupi i k\u00ebrkes\u00ebs: json me vler\u00ebn <code>{\"title\": \"Postimi i ri p\u00ebr fillimin e shpejt\u00eb testmace\"}<\/code><br \/>\nN\u00ebse e keni b\u00ebr\u00eb gjith\u00e7ka si\u00e7 duhet, interface do t\u00eb duket si m\u00eb posht\u00eb:<\/li>\n<\/ul>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"TestMace. Nisje e shpejt\u00eb\" src=\"\/wp-content\/uploads\/2019\/12\/a5c81dc4977dd73a4975643bf8ced3da.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<p>Megjithat\u00eb, n\u00ebse p\u00ebrpiqemi t\u00eb kryejm\u00eb k\u00ebrkes\u00ebn, serveri do t\u00eb kthej\u00eb kodin 401 dhe pa autorizim nuk do t\u00eb kemi mund\u00ebsi t\u00eb veprojm\u00eb n\u00eb k\u00ebt\u00eb server. Si\u00e7 pritej).<\/p>\n<p><\/p>\n<h2 id=\"dobavlyaem-zapros-na-avtorizaciyu\">Shtojm\u00eb k\u00ebrkes\u00ebn p\u00ebr autorizim<\/h2>\n<p><\/p>\n<p>Si\u00e7 u p\u00ebrmend m\u00eb par\u00eb, ne kemi nj\u00eb endpoint POST <code>\/login<\/code>, i cili pranon si trup k\u00ebrkese json t\u00eb formatit: <code>{\"username\": \"&lt;username&gt;\", \"password\": \"&lt;password&gt;\"}<\/code>index <code>username<\/code> dhe <code>password<\/code> (po praprakisht, nga hyrja m\u00eb lart) kan\u00eb kuptime <code>admin<\/code> dhe <code>password<\/code> p\u00ebrkat\u00ebsisht. N\u00eb p\u00ebrgjigje, ky endpoint kthen json t\u00eb formatit <code>{\"token\": \"\"}<\/code>. Do ta p\u00ebrdorim p\u00ebr autorizim. Do t\u00eb krijojm\u00eb <strong>RequestStep<\/strong> nj\u00eb nyje me emrin <strong>login<\/strong>, si prind do t\u00eb sh\u00ebrbej\u00eb <strong>Projekti<\/strong> nyja. Me ndihm\u00ebn e drag-and-drop, zhvendosni k\u00ebt\u00eb nyje n\u00eb pem\u00eb lart se nyja <strong>create-post<\/strong>. Do t'i caktojm\u00eb k\u00ebrkes\u00ebs s\u00eb sapokrijuar parametrat e m\u00ebposht\u00ebm:<\/p>\n<p><\/p>\n<ul>\n<li>Lloji i k\u00ebrkes\u00ebs: POST<\/li>\n<li>url: <noindex><a rel=\"nofollow\" href=\"https:\/\/testmace-quick-start.herokuapp.com\/login\">https:\/\/testmace-quick-start.herokuapp.com\/login<\/a><\/noindex><\/li>\n<li>Trupi i k\u00ebrkes\u00ebs: json me vler\u00ebn <code>{\"username\": \"admin\", \"password\": \"password\"}<\/code><\/li>\n<\/ul>\n<p><\/p>\n<p>Do t\u00eb kryejm\u00eb k\u00ebrkes\u00ebn dhe do t\u00eb marrim kodin dyqind me token n\u00eb p\u00ebrgjigje. M\u00eb ose ndryshe:<\/p>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"TestMace. Nisje e shpejt\u00eb\" src=\"\/wp-content\/uploads\/2019\/12\/222b2a0b965b4c1135b5b62c0b7424ba.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<h2 id=\"refaktoring-ubiraem-dublirovanie-domena\">Rifaktorizimi: heqim p\u00ebrmbajtjen e kopjuar t\u00eb domain-it<\/h2>\n<p><\/p>\n<p>Derisa k\u00ebrkesat nuk jan\u00eb t\u00eb lidhura n\u00eb nj\u00eb skenar t\u00eb vet\u00ebm. Por ky nuk \u00ebsht\u00eb defekti i vet\u00ebm. N\u00ebse e shikoni me kujdes, mund t\u00eb vini re se si minimalisht domain-i kopjohet n\u00eb t\u00eb dyja k\u00ebrkesat. Nuk \u00ebsht\u00eb mir\u00eb. Koha p\u00ebr t\u00eb rifaktorizuar k\u00ebt\u00eb pjes\u00eb t\u00eb skenarit t\u00eb ardhsh\u00ebm dhe n\u00eb k\u00ebt\u00eb do t\u00eb na ndihmojn\u00eb variablat.<\/p>\n<p><\/p>\n<p>N\u00eb qasje t\u00eb par\u00eb, variablat ushtrojn\u00eb t\u00eb nj\u00ebjt\u00ebn rol si n\u00eb mjete dhe gjuh\u00eb t\u00eb tjera programimi \u2014 eliminimi i kopjimit, rritja e lexueshm\u00ebris\u00eb etj. M\u00eb shum\u00eb p\u00ebr variablat mund t\u00eb lexoni n\u00eb <noindex><a rel=\"nofollow\" href=\"https:\/\/docs-ru.testmace.com\/variables\/user-variables\">dokumentacionin ton\u00eb<\/a><\/noindex>. N\u00eb k\u00ebt\u00eb rast, do t\u00eb na nevojiten variablat e p\u00ebrdoruesit. <\/p>\n<p><\/p>\n<p>Do t\u00eb p\u00ebrcaktojm\u00eb n\u00eb nivelin e Projektit t\u00eb nyj\u00ebs variablin <code>domain<\/code> me vler\u00ebn <code>https:\/\/testmace-quick-start.herokuapp.com<\/code>. P\u00ebr k\u00ebt\u00eb \u00ebsht\u00eb e nevojshme<\/p>\n<p><\/p>\n<ul>\n<li>T\u00eb hapni skedarin me k\u00ebt\u00eb nyje dhe t\u00eb klikoni n\u00eb ikon\u00ebn e kalkulatorit n\u00eb t\u00eb djatht\u00eb, lart<\/li>\n<li>Klikoni n\u00eb <strong>+ SHTO VARIABLIN<\/strong><\/li>\n<li>Shkruani emrin dhe vler\u00ebn e variablit<br \/>\nN\u00eb rastin ton\u00eb, dialogu me variablin e shtuar do t\u00eb duket si m\u00eb posht\u00eb:<\/li>\n<\/ul>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"TestMace. Nisje e shpejt\u00eb\" src=\"\/wp-content\/uploads\/2019\/12\/071ac6dca2c5a49b78b11719fae5f650.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<p>OK. Tani me an\u00eb t\u00eb trash\u00ebgimis\u00eb mund t\u00eb p\u00ebrdorim k\u00ebt\u00eb variab\u00ebl n\u00eb pasardh\u00ebsit e \u00e7do niveli t\u00eb thell\u00ebsis\u00eb. N\u00eb rastin ton\u00eb jan\u00eb nyjat <strong>login<\/strong> dhe <strong>create-post<\/strong>. P\u00ebr t\u00eb p\u00ebrdorur variablin n\u00eb fush\u00ebn tekstuale, \u00ebsht\u00eb e nevojshme t\u00eb shkruani <code>${}<\/code>. P\u00ebr shembull, url p\u00ebr login shnd\u00ebrrohet n\u00eb <code>${domain}\/login<\/code>, p\u00ebrkat\u00ebsisht p\u00ebr <strong>create-post<\/strong> nyj\u00ebn url do t\u00eb duket si <code>${domain}\/posts<\/code>.<\/p>\n<p><\/p>\n<p>K\u00ebshtu, duke u udh\u00ebhequr nga parimi DRY, ne e p\u00ebrmir\u00ebsuam pak skenarin.<\/p>\n<p><\/p>\n<h2 id=\"sohranyaem-token-v-peremennuyu\">Ruajm\u00eb token n\u00eb variab\u00ebl<\/h2>\n<p><\/p>\n<p>Deri sa ndalon biseda p\u00ebr variablat, le t\u00eb zhvillojm\u00eb pak k\u00ebt\u00eb tem\u00eb. N\u00eb momentin e tanish\u00ebm, n\u00eb rast t\u00eb suksessh\u00ebm logimi ne marrim nga serveri nj\u00eb token autorizimi, i cili do t\u00eb na nevojitet n\u00eb k\u00ebrkesat e ardhshme. Le t\u00eb ruajm\u00eb k\u00ebt\u00eb token n\u00eb nj\u00eb variab\u00ebl. Pasi vlera e variablit do t\u00eb p\u00ebrcaktohet gjat\u00eb ekzekutimit t\u00eb skenarit, do t\u00eb p\u00ebrdorim p\u00ebr k\u00ebt\u00eb nj\u00eb mekaniz\u00ebm t\u00eb ve\u00e7ant\u00eb \u2014 <noindex><a rel=\"nofollow\" href=\"https:\/\/docs-ru.testmace.com\/variables\/user-variables\/dynamic-variables\">variablat dinamik\u00eb<\/a><\/noindex>.<\/p>\n<p><\/p>\n<p>S\u00eb pari, do t\u00eb b\u00ebjm\u00eb nj\u00eb k\u00ebrkes\u00eb p\u00ebr login. N\u00eb sked\u00ebn <strong>Parsed<\/strong> \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430\u0432\u0435\u0434\u0438\u0442\u0435 \u043a\u0443\u0440\u0441\u043e\u0440 \u043d\u0430 \u0442\u043e\u043a\u0435\u043d \u0438 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e\u043c \u043c\u0435\u043d\u044e (\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043b\u0438\u0431\u043e \u043f\u0440\u0430\u0432\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u043e\u0439 \u043c\u044b\u0448\u0438, \u043b\u0438\u0431\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u0435\u043c \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 &#8230;) \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u0443\u043d\u043a\u0442 <strong>Cakto n\u00eb variab\u00ebl<\/strong>. Nj\u00eb dialog do t\u00eb shfaqet me fushat e m\u00ebposhtme:<\/p>\n<p><\/p>\n<ul>\n<li><strong>Path<\/strong> \u2014 cila pjes\u00eb e p\u00ebrgjigjes merret (n\u00eb rastin ton\u00eb kjo \u00ebsht\u00eb <code>body.token<\/code>)<\/li>\n<li><strong>Current value<\/strong> \u2014 cil\u00ebsimi q\u00eb ndodhet n\u00eb rrug\u00ebn Path (n\u00eb rastin ton\u00eb ky \u00ebsht\u00eb vlera e tokenit)<\/li>\n<li><strong>Emri i variabl\u00ebs<\/strong> \u2014 emri i variabl\u00ebs ku <strong>Current value<\/strong> do t\u00eb ruhen. N\u00eb rastin ton\u00eb, kjo do t\u00eb jet\u00eb <code>token<\/code><\/li>\n<li><strong>Nyja<\/strong> \u2014 n\u00eb cilin nga paraardh\u00ebsit do t\u00eb krijohet variabla <strong>Emri i variabl\u00ebs<\/strong>. Zgjidhni Projektin<\/li>\n<\/ul>\n<p><\/p>\n<p>Dialogu i plot\u00ebsuar duket si m\u00eb posht\u00eb:<\/p>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"TestMace. Nisje e shpejt\u00eb\" src=\"\/wp-content\/uploads\/2019\/12\/f524934dd1a4cb238afb6666135b360b.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<p>Tani, me \u00e7do ekzekutim t\u00eb nyj\u00ebs <strong>login<\/strong> variabla dinamike <code>token<\/code> do t\u00eb p\u00ebrdit\u00ebsohet me vler\u00ebn e re nga p\u00ebrgjigjja. Dhe kjo variabl\u00eb do t\u00eb ruhet n\u00eb <strong>Projekti<\/strong> nyj\u00eb dhe p\u00ebrmes trash\u00ebgimis\u00eb do t\u00eb jet\u00eb e aksesueshme p\u00ebr pasardh\u00ebsit.<\/p>\n<p><\/p>\n<p>P\u00ebr t\u00eb b\u00ebr\u00eb kall\u00ebzim n\u00eb variablat dinamike, \u00ebsht\u00eb e nevojshme t\u00eb p\u00ebrdorim <noindex><a rel=\"nofollow\" href=\"https:\/\/docs-ru.testmace.com\/variables\/variables\">variabl\u00ebn e integruar<\/a><\/noindex> <code>$dynamicVar<\/code>. P\u00ebr shembull, p\u00ebr t\u00eb arritur tokenin e ruajtur, \u00ebsht\u00eb e nevojshme t\u00eb th\u00ebrras\u00ebsh <code>${$dynamicVar.token}<\/code>.<\/p>\n<p><\/p>\n<h2 id=\"prokidyvaem-avtorizacionnyy-token-v-zaprosy\">P\u00ebrfshini tokenin e autorizimit n\u00eb k\u00ebrkesa<\/h2>\n<p><\/p>\n<p>N\u00eb hapat e m\u00ebparsh\u00ebm, mor\u00ebm tokenin e autorizimit dhe gjith\u00e7ka q\u00eb duhet t\u00eb b\u00ebjm\u00eb \u00ebsht\u00eb t\u00eb shtojm\u00eb titullin <code>Authorization<\/code> me vler\u00ebn <code>Bearer<\/code> n\u00eb t\u00eb gjitha k\u00ebrkesat q\u00eb k\u00ebrkojn\u00eb autorizim, p\u00ebrfshir\u00eb edhe n\u00eb <strong>create-post<\/strong>. P\u00ebr k\u00ebt\u00eb ekzistojn\u00eb disa m\u00ebnyra:<\/p>\n<p><\/p>\n<ol>\n<li>\u0412\u0440\u0443\u0447\u043d\u0443\u044e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043a\u0435\u043d \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0432 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b. \u0421\u043f\u043e\u0441\u043e\u0431 \u0440\u0430\u0431\u043e\u0447\u0438\u0439, \u043e\u0434\u043d\u0430\u043a\u043e \u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438 \u0432\u0438\u0434\u0430 &#171;\u0441\u0434\u0435\u043b\u0430\u043b \u0438 \u0432\u044b\u043a\u0438\u043d\u0443\u043b&#187;. \u0414\u043b\u044f \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 \u043d\u0435 \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442<\/li>\n<li>P\u00ebrdorni funksionalitetin <noindex><a rel=\"nofollow\" href=\"https:\/\/docs-ru.testmace.com\/work-with\/authorization\">t\u00eb autorizimit<\/a><\/noindex>.<\/li>\n<li>P\u00ebrdorni <noindex><a rel=\"nofollow\" href=\"https:\/\/docs-ru.testmace.com\/other\/default-http-headers\">titujt n\u00eb default<\/a><\/noindex><\/li>\n<\/ol>\n<p><\/p>\n<p>P\u00ebrdorimi i m\u00ebnyr\u00ebs s\u00eb dyt\u00eb duket i qart\u00eb, megjithat\u00eb n\u00eb kontekstin e k\u00ebtij artikulli ky qasje\u2026 nuk \u00ebsht\u00eb interesante. Epo, n\u00eb t\u00eb v\u00ebrtet\u00eb: mekanizmi i autorizimeve plus minus njohur p\u00ebr ju nga vegla t\u00eb tjera (edhe pse ne kemi gj\u00ebra si <noindex><a rel=\"nofollow\" href=\"https:\/\/docs-ru.testmace.com\/work-with\/authorization#inherit-from-parent\">trash\u00ebgimia e autorizimeve<\/a><\/noindex>) dhe me siguri nuk do t\u00eb shkaktoj\u00eb pyetje. <\/p>\n<p><\/p>\n<p>Nj\u00eb tjet\u00ebr \u00e7\u00ebshtje jan\u00eb titujt standard! N\u00ebse i japim nj\u00eb p\u00ebrmbledhje, titujt standard jan\u00eb tituj q\u00eb trash\u00ebgohen nga parardh\u00ebsit HTTP, t\u00eb cil\u00ebt shtohen automatikisht n\u00eb k\u00ebrkes\u00eb n\u00ebse nuk \u00e7aktivizohen shprehimisht. Me k\u00ebt\u00eb funksionalitet, mund t\u00eb realizojm\u00eb p\u00ebr shembull, nj\u00eb autorizim t\u00eb personalizuar ose thjesht t\u00eb eliminojm\u00eb rip\u00ebrs\u00ebritjen n\u00eb skenar\u00eb. Le ta zbatojm\u00eb k\u00ebt\u00eb tipar p\u00ebr t\u00eb kaluar token n\u00eb tituj.<\/p>\n<p><\/p>\n<p>M\u00eb par\u00eb ne e ruajt\u00ebm me kujdes token n\u00eb nj\u00eb variab\u00ebl dinamike <code>$dynamicVar.token<\/code> n\u00eb nivelin e nyj\u00ebs Project. Mbetej t\u00eb b\u00ebjm\u00eb t\u00eb m\u00ebposhtmen:<\/p>\n<p><\/p>\n<ol>\n<li>T\u00eb p\u00ebrcaktojm\u00eb titullin standard <code>Authorization<\/code> me vler\u00ebn <code>Bearer ${$dynamicVar.token}<\/code> n\u00eb nivelin e nyj\u00ebs Project. P\u00ebr k\u00ebt\u00eb, n\u00eb nd\u00ebrfaqen e nyj\u00ebs Project duhet t\u00eb hapim dialogun me titujt standard (butoni <strong>Headers<\/strong> n\u00eb k\u00ebndin e sip\u00ebrm djathtas) dhe t\u00eb shtojm\u00eb titullin p\u00ebrkat\u00ebs. Dialogu me vlerat e mbushura do t\u00eb duket si m\u00eb posht\u00eb:<br \/>\n<img decoding=\"async\" alt=\"TestMace. Nisje e shpejt\u00eb\" src=\"\/wp-content\/uploads\/2019\/12\/9abd888cbf96e53b633e8f0fd3389297.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/li>\n<li>\u00c7aktivizoni k\u00ebt\u00eb titull nga k\u00ebrkesa login. Kjo \u00ebsht\u00eb e kuptueshme: n\u00eb momentin e login, ende nuk kemi token dhe me k\u00ebt\u00eb k\u00ebrkes\u00eb pik\u00ebrisht do ta vendosim at\u00eb. Prandaj, n\u00eb nd\u00ebrfaqen e k\u00ebrkes\u00ebs login n\u00eb sked\u00ebn <strong>Headers<\/strong> n\u00eb zon\u00ebn <strong>Inherited<\/strong> do t\u00eb heqim shenj\u00ebn nga titulli Authorization. <\/li>\n<\/ol>\n<p><\/p>\n<p>K\u00ebtu \u00ebsht\u00eb gjith\u00e7ka. Tani titulli i autorizimit do t\u00eb shtohet n\u00eb t\u00eb gjitha k\u00ebrkesat q\u00eb jan\u00eb pasardh\u00ebs t\u00eb nyj\u00ebs Project, p\u00ebrve\u00e7 nyjes login. Pra, n\u00eb k\u00ebt\u00eb etap\u00eb, kemi p\u00ebrgatitur tashm\u00eb skenarin dhe na mbetet vet\u00ebm ta nisnim at\u00eb. Mund ta nisim skenarin, duke zgjedhur opsionin <strong>Ekzekuto<\/strong> n\u00eb menun\u00eb kontekstuale t\u00eb nyj\u00ebs Project. <\/p>\n<p><\/p>\n<h2 id=\"proveryaem-korrektnost-sozdaniya-posta\">Verifikojm\u00eb sakt\u00ebsin\u00eb e krijimit t\u00eb postit<\/h2>\n<p><\/p>\n<p>N\u00eb k\u00ebt\u00eb etap\u00eb skenari yn\u00eb \u00ebsht\u00eb n\u00eb gjendje t\u00eb b\u00ebj\u00eb login, dhe duke p\u00ebrdorur tokenin e autorizimit, t\u00eb krijoj\u00eb nj\u00eb post\u00eb. Megjithat\u00eb, duhet t\u00eb sigurohemi q\u00eb posti i sapokrijuar ka nj\u00eb em\u00ebr t\u00eb sakt\u00eb. K\u00ebshtu q\u00eb n\u00eb thelb mbetet t\u00eb b\u00ebjm\u00eb t\u00eb m\u00ebposhtmen:<\/p>\n<p><\/p>\n<ul>\n<li>T\u00eb d\u00ebrgojm\u00eb nj\u00eb k\u00ebrkes\u00eb p\u00ebr t\u00eb marr\u00eb postimin sipas id, <\/li>\n<li>T\u00eb kontrollojm\u00eb q\u00eb emri, i ardhur nga serveri, p\u00ebrputhet me emrin e d\u00ebrguar gjat\u00eb krijimit t\u00eb postit.<\/li>\n<\/ul>\n<p><\/p>\n<p>Le t\u00eb shqyrtojm\u00eb hapin e par\u00eb. Duke qen\u00eb se vlera e id p\u00ebrcaktohet gjat\u00eb ekzekutimit t\u00eb skenarit, duhet t\u00eb krijojm\u00eb nj\u00eb variab\u00ebl dinamike (ta quajm\u00eb <code>postId<\/code>) nga nyja <strong>create-post<\/strong> n\u00eb nivelin e nyj\u00ebs Project. Si ta b\u00ebjm\u00eb k\u00ebt\u00eb tashm\u00eb e dim\u00eb, mjafton t\u00eb konsultohemi me seksionin <strong>Ruajm\u00eb token n\u00eb variab\u00ebl<\/strong>. Mbetej vet\u00ebm t\u00eb krijojm\u00eb nj\u00eb k\u00ebrkes\u00eb p\u00ebr t\u00eb marr\u00eb postin sipas k\u00ebtij id. P\u00ebr k\u00ebt\u00eb, do t\u00eb krijojm\u00eb nj\u00eb RequestStep <strong>get-post<\/strong> me parametrat e m\u00ebposht\u00ebm:<\/p>\n<p><\/p>\n<ul>\n<li>Lloji i k\u00ebrkes\u00ebs: GET<\/li>\n<li>URL: ${domain}\/posts\/${$dynamicVar.postId}<\/li>\n<\/ul>\n<p><\/p>\n<p>P\u00ebr t\u00eb realizuar hapat e dyt\u00eb, ne duhet t\u00eb njihemi me <noindex><a rel=\"nofollow\" href=\"https:\/\/docs-ru.testmace.com\/node-types\/assertion\">Assertion<\/a><\/noindex> nyj\u00ebn. Nj\u00eb nyj\u00eb Assertion \u2014 \u00ebsht\u00eb nj\u00eb nyj\u00eb q\u00eb lejon t\u00eb shkruhen verifikime p\u00ebr k\u00ebrkesa t\u00eb caktuara. \u00c7do nyj\u00eb Assertion mund t\u00eb p\u00ebrmbaj\u00eb disa propozime (verifikime). M\u00eb shum\u00eb rreth t\u00eb gjitha llojeve t\u00eb assertion-eve mund t\u00eb lexoni n\u00eb <noindex><a rel=\"nofollow\" href=\"https:\/\/docs-ru.testmace.com\/node-types\/assertion\">dokumentacionin<\/a><\/noindex>. Ne do t\u00eb p\u00ebrdorim <code>Krahaso<\/code> assertion me operatorin <code>baraz<\/code>. Ka disa m\u00ebnyra p\u00ebr t\u00eb krijuar assertion-e:<\/p>\n<p><\/p>\n<ol>\n<li>T\u00eb ngadalta. N\u00eb m\u00ebnyr\u00eb manuale nga menuja kontekstuale e nyj\u00ebs RequestStep ndiheni t\u00eb krijoni nj\u00eb nyj\u00eb Assertion. N\u00eb nyj\u00ebn e krijuar Assertion shtoni assertion-in q\u00eb ju intereson dhe plot\u00ebsoni fushat.<\/li>\n<li>T\u00eb shpejta. Krijoni nj\u00eb nyj\u00eb Assertion s\u00eb bashku me assertion-in nga p\u00ebrgjigjja e nyj\u00ebs RequestStep me an\u00eb t\u00eb menuve kontekstuale.<\/li>\n<\/ol>\n<p><\/p>\n<p>Le t\u00eb p\u00ebrdorim m\u00ebnyr\u00ebn e dyt\u00eb. Ja si do t\u00eb duket p\u00ebr rastin ton\u00eb.<\/p>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"TestMace. Nisje e shpejt\u00eb\" src=\"\/wp-content\/uploads\/2019\/12\/7f1d81669cb4c10db5f0afa3bf04eddf.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<p>P\u00ebr ata q\u00eb nuk e kuptuan, k\u00ebtu ndodh kjo:<\/p>\n<p><\/p>\n<ol>\n<li>B\u00ebni nj\u00eb k\u00ebrkes\u00eb n\u00eb nyj\u00ebn <strong>get-post<\/strong><\/li>\n<li>N\u00eb tab <strong>Parsed<\/strong> n\u00eb p\u00ebrgjigje thirrni menun\u00eb kontekstuale dhe zgjidhni <strong>Krijo assertion<\/strong> -&gt; <strong>Krahaso<\/strong> -&gt; <strong>Baraz<\/strong><\/li>\n<\/ol>\n<p><\/p>\n<p>Grat\u00eb t\u00eb lutem, kemi krijuar testin ton\u00eb t\u00eb par\u00eb! E thjesht\u00eb, apo jo? Tani mund t\u00eb ekzekutoni skenarin n\u00eb t\u00ebr\u00ebsi dhe t\u00eb shijoni rezultatin. Mbetet vet\u00ebm t\u00eb refaktorizoni pak dhe t\u00eb \u00e7oni <code>titullin<\/code> n\u00eb nj\u00eb variab\u00ebl t\u00eb ve\u00e7ant\u00eb. Por ne do ta l\u00ebm\u00eb k\u00ebt\u00eb si detyr\u00eb p\u00ebr ju)<\/p>\n<p><\/p>\n<h1 id=\"zaklyuchenie\">P\u00ebrfundim<\/h1>\n<p><\/p>\n<p>N\u00eb k\u00ebt\u00eb udh\u00ebzues kemi krijuar nj\u00eb skenar t\u00eb plot\u00eb dhe po ashtu kemi b\u00ebr\u00eb nj\u00eb p\u00ebrmbledhje t\u00eb disa ve\u00e7orive t\u00eb produktit ton\u00eb. Sigurisht, nuk kemi shfryt\u00ebzuar t\u00eb gjith\u00eb funksionalitetin dhe n\u00eb artikujt e ardhsh\u00ebm do t\u00eb b\u00ebjm\u00eb nj\u00eb p\u00ebrmbledhje t\u00eb holl\u00ebsishme t\u00eb mund\u00ebsive t\u00eb TestMace. Ndiqni p\u00ebrdit\u00ebsimet!<\/p>\n<p><\/p>\n<p>P.S. P\u00ebr ata q\u00eb jan\u00eb t\u00eb lodhur p\u00ebr t\u00eb riprodhuar t\u00eb gjitha hapat, ne me dashuri kemi p\u00ebrgatitur <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/TestMace\/testmace-quick-start-project\">repozitori<\/a><\/noindex> me projektin nga artikulli. Mund ta hapni duke <strong>Skedari<\/strong> -&gt; <strong>Hapur projektin<\/strong> dhe zgjidhni dosjen Project.<\/p>\n<p>Burimi: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/458964\/\">habr.com<\/a><\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442. \u041c\u044b \u043f\u043e\u0442\u0438\u0445\u043e\u043d\u044c\u043a\u0443 \u0432\u044b\u0445\u043e\u0434\u0438\u043c \u0438\u0437 \u0442\u0435\u043d\u0438 \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0441\u0435\u0440\u0438\u044e \u0441\u0442\u0430\u0442\u0435\u0439 \u043e \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0435. \u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u043e\u0431\u0437\u043e\u0440\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043e\u0442\u0437\u044b\u0432\u043e\u0432 (\u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445), \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438 bug \u0440\u0435\u043f\u043e\u0440\u0442\u043e\u0432. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043f\u043e\u043a\u0430\u0436\u0435\u043c TestMace \u0432 \u0434\u0435\u043b\u0435 \u0438 \u0432\u044b \u043f\u043e \u0434\u043e\u0441\u0442\u043e\u0438\u043d\u0441\u0442\u0432\u0443 \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0444\u0438\u0448\u043a\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u043f\u043e\u0433\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0441\u043e\u0432\u0435\u0442\u0443\u044e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u043d\u0430\u0448\u0435\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[702],"tags":[],"class_list":["post-54167","post","type-post","status-publish","format-standard","hentry","category-news"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.1.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/sq\/blog\/news\/testmace-bystryj-start\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.1.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"sq_AL\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47TestMace. \u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u0441\u0442\u0430\u0440\u0442 | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/sq\/blog\/news\/testmace-bystryj-start\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2019-12-18T21:00:00+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2020-02-18T11:02:08+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47TestMace. Fillimi i shpejt\u00eb | ProHoster","description":"P\u00ebrsh\u00ebndetje t\u00eb gjith\u00ebve.","canonical_url":"https:\/\/prohoster.info\/sq\/blog\/news\/testmace-bystryj-start","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"sq_AL","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47TestMace. \u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u0441\u0442\u0430\u0440\u0442 | ProHoster","og:description":"\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442.","og:url":"https:\/\/prohoster.info\/sq\/blog\/news\/testmace-bystryj-start","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2019-12-18T21:00:00+00:00","article:modified_time":"2020-02-18T11:02:08+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"54167","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":"2026-01-24 10:17:19","breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-02-28 20:10:34","updated":"2026-01-24 10:17:19","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts\/54167","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/comments?post=54167"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts\/54167\/revisions"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/media?parent=54167"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/categories?post=54167"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/tags?post=54167"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}