From 789c6f6445678678c7887aadd53d0a5e3411bf39 Mon Sep 17 00:00:00 2001 From: vickytechkey Date: Sun, 9 Aug 2026 21:33:35 +0530 Subject: [PATCH] updating the api base --- cypress/downloads/seller_product_template.csv | 3 --- cypress/e2e/api.cy.ts | 16 ++++++++-------- src/config.ts | 2 +- 3 files changed, 9 insertions(+), 12 deletions(-) delete mode 100644 cypress/downloads/seller_product_template.csv diff --git a/cypress/downloads/seller_product_template.csv b/cypress/downloads/seller_product_template.csv deleted file mode 100644 index 6ade7ad..0000000 --- a/cypress/downloads/seller_product_template.csv +++ /dev/null @@ -1,3 +0,0 @@ -Title,SKU,Category,Price,Stock,Description -Silk Banarasi Saree,SAR-BAN-101,Apparel,120.00,15,Pure handloom zardozi border -Wooden Carved Ganesha,GAN-302,Home Decor,85.00,5,Premium teak wood hand carved \ No newline at end of file diff --git a/cypress/e2e/api.cy.ts b/cypress/e2e/api.cy.ts index dedc203..9a699c7 100644 --- a/cypress/e2e/api.cy.ts +++ b/cypress/e2e/api.cy.ts @@ -1,8 +1,8 @@ describe('Seller Central Django Backend API E2E Tests', () => { - const backendUrl = 'http://localhost:8000'; + const backendUrl = 'http://16.113.57.127:8080/api'; it('verifies product list', () => { - cy.request(`${backendUrl}/api/products/`).then((response) => { + cy.request(`${backendUrl}/products/`).then((response) => { expect(response.status).to.eq(200); expect(response.body).to.be.an('array'); }); @@ -10,7 +10,7 @@ describe('Seller Central Django Backend API E2E Tests', () => { it('creates and deletes a product', () => { const uniqueSku = `SKU-CY-${Date.now()}`; - cy.request('POST', `${backendUrl}/api/products/`, { + cy.request('POST', `${backendUrl}/products/`, { title: 'Cypress Test Silk Scarf', category: 'Apparel', price: '55.00', @@ -22,21 +22,21 @@ describe('Seller Central Django Backend API E2E Tests', () => { const prodId = response.body.id; // Delete the created product - cy.request('DELETE', `${backendUrl}/api/products/${prodId}/`).then((delRes) => { + cy.request('DELETE', `${backendUrl}/products/${prodId}/`).then((delRes) => { expect(delRes.status).to.eq(204); // django rest framework delete returns 204 No Content }); }); }); it('verifies order list and acceptance', () => { - cy.request(`${backendUrl}/api/orders/`).then((response) => { + cy.request(`${backendUrl}/orders/`).then((response) => { expect(response.status).to.eq(200); expect(response.body).to.be.an('array'); expect(response.body.length).to.be.greaterThan(0); const pendingOrder = response.body.find((o: any) => o.status === 'Pending Acceptance'); if (pendingOrder) { - cy.request('POST', `${backendUrl}/api/orders/${pendingOrder.id}/accept/`).then((acceptRes) => { + cy.request('POST', `${backendUrl}/orders/${pendingOrder.id}/accept/`).then((acceptRes) => { expect(acceptRes.status).to.eq(200); expect(acceptRes.body.status).to.eq('Ready to Ship'); }); @@ -45,14 +45,14 @@ describe('Seller Central Django Backend API E2E Tests', () => { }); it('verifies wallet summary and payout withdrawal', () => { - cy.request(`${backendUrl}/api/wallet/`).then((response) => { + cy.request(`${backendUrl}/wallet/`).then((response) => { expect(response.status).to.eq(200); expect(response.body).to.have.property('outstanding'); expect(response.body).to.have.property('withdrawn'); const currentOutstanding = parseFloat(response.body.outstanding); if (currentOutstanding > 10) { - cy.request('POST', `${backendUrl}/api/wallet/withdraw/`, { amount: '10.00' }).then((withdrawRes) => { + cy.request('POST', `${backendUrl}/wallet/withdraw/`, { amount: '10.00' }).then((withdrawRes) => { expect(withdrawRes.status).to.eq(200); expect(parseFloat(withdrawRes.body.outstanding)).to.eq(currentOutstanding - 10); }); diff --git a/src/config.ts b/src/config.ts index 761e00b..d289376 100644 --- a/src/config.ts +++ b/src/config.ts @@ -6,7 +6,7 @@ const getApiBaseUrl = () => { }; export const CONFIG = { - apiBaseUrl: getApiBaseUrl(), + apiBaseUrl: 'http://16.113.57.127:8080', companyName: 'Global Artisans Hub', logoLetter: 'A', supportEmail: 'support@globalartisanshub.com',