update cypress:run to use headed mode
All checks were successful
Beta CI/CD Pipeline / build-and-test (push) Successful in 44s
Beta CI/CD Pipeline / deploy-beta (push) Successful in 6s

This commit is contained in:
vickytechkey 2026-08-09 11:28:41 +05:30
parent ef9d48020a
commit 1bb45cdee0
5 changed files with 2249 additions and 1 deletions

9
cypress.config.ts Normal file
View file

@ -0,0 +1,9 @@
import { defineConfig } from "cypress";
export default defineConfig({
e2e: {
baseUrl: "http://localhost:5173",
supportFile: false,
specPattern: "cypress/e2e/**/*.cy.{js,jsx,ts,tsx}"
},
});

View file

@ -0,0 +1,3 @@
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 Title SKU Category Price Stock Description
2 Silk Banarasi Saree SAR-BAN-101 Apparel 120.00 15 Pure handloom zardozi border
3 Wooden Carved Ganesha GAN-302 Home Decor 85.00 5 Premium teak wood hand carved

View file

@ -0,0 +1,101 @@
describe('Supplier Portal Onboarding & Feature E2E Flow', () => {
it('completes the registration, contact verification, document upload, location pinning, welcome tour, order acceptance, and barcode generation', () => {
// 1. Visit Landing Page
cy.visit('/');
cy.contains('Sell Globally.').should('be.visible');
// 2. Registration Page
cy.contains('Get Started Today').click();
cy.get('input#reg-email').type('test_seller@example.com');
cy.get('input#reg-phone').type('9876543210');
cy.get('input#reg-pass').type('super_secure_pass_123');
cy.get('button').contains('Register Business').click();
// 3. Step 1: Contact Verification
cy.contains('Step 1 of 3: Contact Verification').should('be.visible');
cy.contains('Send WhatsApp OTP').click();
cy.get('input[placeholder="Enter 123456"]').first().type('123456');
cy.contains('Verify Code').first().click();
cy.contains('✓ Mobile & WhatsApp Verified').should('be.visible');
cy.contains('Send Email OTP').click();
cy.get('input[placeholder="Enter 123456"]').last().type('123456');
cy.contains('Verify Code').last().click();
cy.contains('✓ Email Verified').should('be.visible');
cy.contains('Next Step: Identity Verification').click();
// 4. Step 2: Tax & Identity Verification
cy.contains('Step 2 of 3: Tax & Identity Verification').should('be.visible');
cy.get('input#verify-gst').clear().type('29AAAAA1111A1Z1');
cy.contains('Verify GSTIN').click();
cy.contains('GSTIN successfully verified with government registry.').should('be.visible');
// Upload mock Aadhaar & PAN files
cy.get('input#aadhar-upload').selectFile({
contents: Cypress.Buffer.from('mock aadhaar pdf'),
fileName: 'aadhar_card.pdf',
mimeType: 'application/pdf',
}, { force: true });
cy.contains('Selected: aadhar_card.pdf').should('be.visible');
cy.get('input#pan-upload').selectFile({
contents: Cypress.Buffer.from('mock pan pdf'),
fileName: 'pan_card.pdf',
mimeType: 'application/pdf',
}, { force: true });
cy.contains('Selected: pan_card.pdf').should('be.visible');
cy.contains('Next Step: Store & Location').click();
// 5. Step 3: Store & Pickup Location Setup
cy.contains('Step 3 of 3: Store & Pickup Location').should('be.visible');
cy.get('input#store-name').clear().type('Teak Wood Craft Store');
cy.get('textarea#store-bio').clear().type('Teak wood hand-carved home decor elements.');
// Test interactive map coordinate pinning
cy.contains('Store Location on Map *').should('be.visible');
cy.get('span').contains('Click anywhere on the map grid to pin location').parent().click(100, 80);
cy.contains('Coordinates: Lat').should('be.visible');
cy.get('input#location-text').should('not.have.value', '');
cy.get('input#loc-city').clear().type('Bangalore');
cy.get('input#loc-pincode').clear().type('560001');
cy.contains('Submit Supplier Profile').click();
// 6. Setup Welcome Tour Stepper
cy.contains('Welcome to Global Artisans Hub! 🎉').should('be.visible');
cy.contains('Start Tour').click();
cy.contains('📦 Products & Inventory Management').should('be.visible');
cy.contains('Next: Order Management').click();
cy.contains('🚚 Order Acceptance Control').should('be.visible');
cy.contains('Next: Barcode Generation').click();
cy.contains('🏷️ Barcode Identification & Tracking').should('be.visible');
cy.contains('Next: Earnings & Wallet').click();
cy.contains('💼 Wallet & Payout Withdrawals').should('be.visible');
cy.contains('Launch Dashboard 🚀').click();
// 7. Check Active Dashboard Tab
cy.contains('Performance Analytics').should('be.visible');
// 8. Manage Products tab & Bulk template download
cy.contains('Manage Products').click();
cy.contains('Active Inventory').should('be.visible');
cy.contains('📥 Download Sample Excel Template').click();
// 9. Orders Acceptance Flow
cy.contains('Orders & Transit').click();
cy.contains('Active Orders & Payout status').should('be.visible');
cy.contains('Pending Acceptance').should('be.visible');
cy.get('button').contains('Accept').first().click();
cy.contains('Ready to Ship').should('be.visible');
// 10. Barcode Generator
cy.contains('Barcode Generator').click();
cy.contains('Product Barcode Generator').should('be.visible');
cy.get('select#barcode-product').select(1);
cy.contains('Generate Barcode Graphic').click();
cy.contains('Generated Barcode Preview').should('be.visible');
cy.contains('Print Label').should('be.visible');
cy.contains('Download SVG').should('be.visible');
});
});

2132
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -8,7 +8,9 @@
"build": "tsc -b && vite build", "build": "tsc -b && vite build",
"lint": "oxlint", "lint": "oxlint",
"test": "vitest run", "test": "vitest run",
"preview": "vite preview" "preview": "vite preview",
"cypress:run": "cypress run --headed",
"cypress:open": "cypress open"
}, },
"dependencies": { "dependencies": {
"react": "^19.2.8", "react": "^19.2.8",
@ -22,6 +24,7 @@
"@types/react": "^19.2.17", "@types/react": "^19.2.17",
"@types/react-dom": "^19.2.3", "@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^6.0.4", "@vitejs/plugin-react": "^6.0.4",
"cypress": "^15.20.0",
"jsdom": "^30.0.1", "jsdom": "^30.0.1",
"oxlint": "^1.75.0", "oxlint": "^1.75.0",
"typescript": "~6.0.2", "typescript": "~6.0.2",