Skip to content

Commit

Permalink
Merge pull request #149 from Samagra-Anamaya/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
amit-s19 authored Aug 12, 2024
2 parents 342e313 + 8e51cdd commit f1c11d3
Show file tree
Hide file tree
Showing 138 changed files with 76,465 additions and 7,425 deletions.
3 changes: 0 additions & 3 deletions .eslintrc.json

This file was deleted.

6 changes: 6 additions & 0 deletions .eslintrc.jsondd
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": [
"samagra-ui-configs/rules/eslint.js",
"next/core-web-vitals"
]
}
163 changes: 68 additions & 95 deletions browserstack.json
Original file line number Diff line number Diff line change
@@ -1,96 +1,69 @@
{
"auth": {
"username": "",
"access_key": ""
},
"browsers": [
{
"browser": "chrome",
"os": "Windows 10",
"versions": [
"latest",
"latest-1"
]
},
{
"browser": "firefox",
"os": "Windows 10",
"versions": [
"latest",
"latest-1"
]
},
{
"browser": "edge",
"os": "Windows 10",
"versions": [
"latest",
"latest-1"
]
},
{
"browser": "chrome",
"os": "OS X Mojave",
"versions": [
"latest",
"latest-1"
]
},
{
"browser": "firefox",
"os": "OS X Mojave",
"versions": [
"latest",
"latest-1"
]
},
{
"browser": "edge",
"os": "OS X Mojave",
"versions": [
"latest",
"latest-1"
]
},
{
"browser": "chrome",
"os": "OS X Catalina",
"versions": [
"latest",
"latest-1"
]
},
{
"browser": "firefox",
"os": "OS X Catalina",
"versions": [
"latest",
"latest-1"
]
},
{
"browser": "edge",
"os": "OS X Catalina",
"versions": [
"latest",
"latest-1"
]
}
],
"run_settings": {
"cypress_config_file": "./cypress.config.ts",
"project_name": "Stride",
"build_name": ".next",
"exclude": [],
"parallels": 5,
"headless": true
},
"connection_settings": {
"local": false,
"local_identifier": null,
"local_mode": null,
"local_config_file": null
},

"disable_usage_reporting": false
}
"auth": {
"username": "",
"access_key": ""
},
"browsers": [
{
"browser": "chrome",
"os": "Windows 10",
"versions": ["latest", "latest-1"]
},
{
"browser": "firefox",
"os": "Windows 10",
"versions": ["latest", "latest-1"]
},
{
"browser": "edge",
"os": "Windows 10",
"versions": ["latest", "latest-1"]
},
{
"browser": "chrome",
"os": "OS X Mojave",
"versions": ["latest", "latest-1"]
},
{
"browser": "firefox",
"os": "OS X Mojave",
"versions": ["latest", "latest-1"]
},
{
"browser": "edge",
"os": "OS X Mojave",
"versions": ["latest", "latest-1"]
},
{
"browser": "chrome",
"os": "OS X Catalina",
"versions": ["latest", "latest-1"]
},
{
"browser": "firefox",
"os": "OS X Catalina",
"versions": ["latest", "latest-1"]
},
{
"browser": "edge",
"os": "OS X Catalina",
"versions": ["latest", "latest-1"]
}
],
"run_settings": {
"cypress_config_file": "./cypress.config.ts",
"project_name": "Stride",
"build_name": ".next",
"exclude": [],
"parallels": 5,
"headless": true
},
"connection_settings": {
"local": false,
"local_identifier": null,
"local_mode": null,
"local_config_file": null
},

"disable_usage_reporting": false
}
28 changes: 14 additions & 14 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { defineConfig } from "cypress";
import { defineConfig } from 'cypress';

export default defineConfig({
e2e: {
baseUrl: "http://localhost:3000",
setupNodeEvents(on, config) {
// implement node event listeners here
},
testIsolation: false,
},
e2e: {
baseUrl: 'http://localhost:3000',
setupNodeEvents(on, config) {
// implement node event listeners here
},
testIsolation: false
},

component: {
devServer: {
framework: "next",
bundler: "webpack",
},
},
component: {
devServer: {
framework: 'next',
bundler: 'webpack'
}
}
});
48 changes: 21 additions & 27 deletions cypress/e2e/SubmittedTitles.cy.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,24 @@
describe('Check Synced Titles Flow', () => {
it('Assert Number of Villages', () => {
cy.visit('/');
cy.wait(1000);
cy.get('#gpVillages').then(($value) => {
cy.get('.villages').should('have.length', $value.text());
});
});

it('Assert Number of Villages', () => {
cy.visit('/')
cy.wait(1000);
cy.get('#gpVillages').then(($value) => {
it('Pick a random village from GP', () => {
cy.get('.villages')
.its('length')
.then((n) => Cypress._.random(0, n - 1))
.then((k) => {
cy.log(`picked random index ${k}`);
// get all elements again and pick one
cy.get('.villages').eq(k).click();
});
});

cy.get('.villages')
.should('have.length', $value.text())
})

})

it('Pick a random village from GP', () => {

cy.get('.villages')
.its('length')
.then((n) => Cypress._.random(0, n - 1))
.then((k) => {
cy.log(`picked random index ${k}`)
// get all elements again and pick one
cy.get('.villages').eq(k).click()
})
})

it('Select Submitted Titles', () => {
cy.get("#submittedTitles").click();
})

})
it('Select Submitted Titles', () => {
cy.get('#submittedTitles').click();
});
});
64 changes: 27 additions & 37 deletions cypress/e2e/SyncedTitles.cy.ts
Original file line number Diff line number Diff line change
@@ -1,38 +1,28 @@
describe('Check Synced Titles Flow', () => {

it('Assert Number of Villages', () => {
cy.visit('/')
cy.wait(1000);
cy.get('#gpVillages').then(($value) => {

cy.get('.villages')
.should('have.length', $value.text())
})

})

it('Pick a random village from GP', () => {

cy.get('.villages')
.its('length')
.then((n) => Cypress._.random(0, n - 1))
.then((k) => {
cy.log(`picked random index ${k}`)
// get all elements again and pick one
cy.get('.villages').eq(k).click()
})
})

it('Select Synced Titles', () => {
cy.get("#syncedTitles").click();
})

it('View a Synced Title', () => {
cy.get('.titles').then(($el) => {


})
})


})
it('Assert Number of Villages', () => {
cy.visit('/');
cy.wait(1000);
cy.get('#gpVillages').then(($value) => {
cy.get('.villages').should('have.length', $value.text());
});
});

it('Pick a random village from GP', () => {
cy.get('.villages')
.its('length')
.then((n) => Cypress._.random(0, n - 1))
.then((k) => {
cy.log(`picked random index ${k}`);
// get all elements again and pick one
cy.get('.villages').eq(k).click();
});
});

it('Select Synced Titles', () => {
cy.get('#syncedTitles').click();
});

it('View a Synced Title', () => {
cy.get('.titles').then(($el) => {});
});
});
32 changes: 14 additions & 18 deletions cypress/e2e/login.cy.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
describe('Login Flow', () => {
const username = "gp_115550";
const password = "pass_115550";
const username = 'gp_115550';
const password = 'pass_115550';

it('Visits the login page', () => {
cy.visit('')
})
it('Visits the login page', () => {
cy.visit('');
});

it('Attempts Login', () => {
it('Attempts Login', () => {
cy.get('#username').type(username);
cy.get('#password').type(password);
cy.get('#loginBtn').click();
});

cy.get('#username').type(username);
cy.get('#password').type(password);
cy.get('#loginBtn').click();

})

it('Assert login is correct', () => {

cy.get('#enumeratorId').should('have.text', username)

})
})
it('Assert login is correct', () => {
cy.get('#enumeratorId').should('have.text', username);
});
});
6 changes: 3 additions & 3 deletions cypress/fixtures/example.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "hello@cypress.io",
"body": "Fixtures are a great way to mock data for responses to routes"
"name": "Using fixtures to represent data",
"email": "hello@cypress.io",
"body": "Fixtures are a great way to mock data for responses to routes"
}
2 changes: 1 addition & 1 deletion cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
// }
// }
// }
// }
Loading

0 comments on commit f1c11d3

Please sign in to comment.