updating the api base
This commit is contained in:
parent
f6ea515196
commit
789c6f6445
3 changed files with 9 additions and 12 deletions
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Reference in a new issue