TC-ADD-01
Positive
changes data Sending a valid catalog
Verify that the system accepts a technically valid product catalog
! Documented discrepancy · errors.txt
All tests in this section: All the import tests return the code 202 and not 200 in case of success.
Specification · xlsx
Steps
- Create a valid payload within the limits
- Send the request to the endpoint
Expected result
HTTP 200; the system accepts the request and returns a confirmation ID
Endpoints
POST /product/api/v1/merchant-integration/import Run
- API_URL
https://api.qa2.ananastest.com
A dry run builds every request without sending it; responses come from a local stub.
Test code
mirrors tests/ImportTest.php::tc_add_01()
13// Verify that the system accepts a technically valid product catalog
14public function tc_add_01(): void
15{
16 $data = [
17 [
18 'name' => 'Samsung Pametni telefon Galaxy SM-A325F plavi',
19 'description' => "Samsung Galaxy SM-A325F. Dijagonala monitora: 16,3 cm (6.4'), Rezolucije ekrana: 1800 x 2400 piksela, Tip ekrana: SAMOLED . Takt procesora: 2 GHz . RAM kapacitet: 4 GB, Kapacitet interne memorije: 128 GB . Rezolucija zadnje kamere(numerička): 64 MP, Tip zadnje kamere: Četvorostruka kamera . Mogućnosti SIM kartice: Dve SIM kartice . Trajanje baterije: 5000 mAh . Boja proizvoda: Plavo . Težina: 184 g",
20 'coverImage' => 'https://ananas.rs/_next/image?url=https%3A%2F%2Fstatic.ananas.rs%2Ftmp%2Fimage-thumbnails%2FProduct_Images%2FSmartphones%2Fsamsung_galaxy_sm_a325f_16_3_cm_6_4_dve_sim_kartice_4g_usb_tipa_c_4_gb_128_gb_5000_mah_plavo%2Fimage-thumb__295826__product_thumbnail%2F951c5c5b9fdddc72.jpeg&w=3200&q=75',
21 'ean' => '9788644105886',
22 'brand' => 'Samsung',
23 'gallery' => [
24 'https://ananas.rs/_next/image?url=https%3A%2F%2Fstatic.ananas.rs%2Ftmp%2Fimage-thumbnails%2FProduct_Images%2FSmartphones%2Fsamsung_galaxy_sm_a325f_16_3_cm_6_4_dve_sim_kartice_4g_usb_tipa_c_4_gb_128_gb_5000_mah_plavo%2Fimage-thumb__295826__product_thumbnail%2F951c5c5b9fdddc72.jpeg&w=3200&q=75',
25 ],
26 'parentEan' => '',
27 'packageWeightValue' => 184,
28 'packageWeightUnit' => 'KG',
29 'packageHeightValue' => 110,
30 'packageLengthValue' => 120,
31 'packageWidthValue' => 130,
32 'productWeightValue' => 180,
33 'productHeightValue' => 100,
34 'productLengthValue' => 110,
35 'productWidthValue' => 120,
36 'basePrice' => 30990,
37 'vat' => 20,
38 'stockLevel' => 5,
39 'sku' => 'LXG9HET6O3',
40 'externalId' => '1',
41 'productType' => 'Telefon',
42 'category' => 'SMART mobilni telefoni',
43 'attributes' => [
44 'Boja' => [
45 'Plava',
46 ],
47 'Standard veličine' => [
48 'Monoblokovi',
49 ],
50 'Sirina' => [
51 '73.6 mm',
52 ],
53 'Dubina' => [
54 '8.4 mm',
55 ],
56 'Visina' => [
57 '158.9 mm',
58 ],
59 'Tezina' => [
60 '184 g',
61 ],
62 ],
63 ],
64 [
65 'name' => 'Samsung Pametni telefon Galaxy SM-A325F plavi2',
66 'description' => "Samsung Galaxy SM-A325F. Dijagonala monitora: 16,3 cm (6.4'), Rezolucije ekrana: 1800 x 2400 piksela, Tip ekrana: SAMOLED . Takt procesora: 2 GHz . RAM kapacitet: 4 GB, Kapacitet interne memorije: 128 GB . Rezolucija zadnje kamere(numerička): 64 MP, Tip zadnje kamere: Četvorostruka kamera . Mogućnosti SIM kartice: Dve SIM kartice . Trajanje baterije: 5000 mAh . Boja proizvoda: Plavo . Težina: 184 g2",
67 'coverImage' => 'https://ananas.rs/_next/image?url=https%3A%2F%2Fstatic.ananas.rs%2Ftmp%2Fimage-thumbnails%2FProduct_Images%2FSmartphones%2Fsamsung_galaxy_sm_a325f_16_3_cm_6_4_dve_sim_kartice_4g_usb_tipa_c_4_gb_128_gb_5000_mah_plavo%2Fimage-thumb__295826__product_thumbnail%2F951c5c5b9fdddc72.jpeg&w=3200&q=752',
68 'ean' => '97886441058862',
69 'brand' => 'Samsung2',
70 'gallery' => [
71 'https://ananas.rs/_next/image?url=https%3A%2F%2Fstatic.ananas.rs%2Ftmp%2Fimage-thumbnails%2FProduct_Images%2FSmartphones%2Fsamsung_galaxy_sm_a325f_16_3_cm_6_4_dve_sim_kartice_4g_usb_tipa_c_4_gb_128_gb_5000_mah_plavo%2Fimage-thumb__295826__product_thumbnail%2F951c5c5b9fdddc72.jpeg&w=3200&q=752',
72 ],
73 'parentEan' => '',
74 'packageWeightValue' => 185,
75 'packageWeightUnit' => 'KG',
76 'packageHeightValue' => 111,
77 'packageLengthValue' => 121,
78 'packageWidthValue' => 131,
79 'productWeightValue' => 181,
80 'productHeightValue' => 101,
81 'productLengthValue' => 111,
82 'productWidthValue' => 121,
83 'basePrice' => 30991,
84 'vat' => 20,
85 'stockLevel' => 5,
86 'sku' => 'LXG9HET6O32',
87 'externalId' => '2',
88 'productType' => 'Telefon',
89 'category' => 'SMART mobilni telefoni',
90 'attributes' => [
91 'Boja' => [
92 'Plava',
93 ],
94 'Standard veličine' => [
95 'Monoblokovi',
96 ],
97 'Sirina' => [
98 '73.6 mm',
99 ],
100 'Dubina' => [
101 '8.4 mm',
102 ],
103 'Visina' => [
104 '158.9 mm',
105 ],
106 'Tezina' => [
107 '184 g',
108 ],
109 ],
110 ],
111 ];
112
113 $response = $this->ananas->addOrEditInBulk($data);
114 $this->assertEquals(202, $response['statusCode']);
115}
web/app/Scenarios/ImportScenarios.php · line numbers refer to this file
Not run yet. Run it against the API, or do a dry run to see the requests it would send.