Skip to content

Commit

Permalink
Solution
Browse files Browse the repository at this point in the history
  • Loading branch information
MarianaQAaug2024 committed Oct 15, 2024
1 parent 4994aed commit a9aef89
Show file tree
Hide file tree
Showing 5 changed files with 5,294 additions and 2,784 deletions.
5 changes: 3 additions & 2 deletions cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ const { defineConfig } = require('cypress');

module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
}
baseUrl: 'https://www.globalsqa.com',
viewportWidth: 1280,
viewportHeight: 720
}
});
55 changes: 55 additions & 0 deletions cypress/e2e/hermioneAccount.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/// <reference types="cypress" />
describe('Hermione Granger Account Flow', () => {
it('Should log in as Hermione Granger and perform deposit and withdrawal',
() => {
cy.visit(
'https://www.globalsqa.com/angularJs-protractor/BankingProject/#/login'
);
cy.contains('Customer Login', { timeout: 10000 })
.should('be.visible');

cy.contains('Customer Login').click();

cy.get('select').select('Hermoine Granger');

cy.contains('Login').should('be.visible').click();

cy.contains('Account Number').parent().should('contain', '1001');

cy.get('strong.ng-binding').should('contain', '5096');

cy.get('strong.ng-binding').contains('Dollar').should('be.visible');

cy.contains('Deposit').click();
cy.get('input[placeholder="amount"]').type('100');
cy.contains('Deposit').click();

cy.get('span.error.ng-binding[ng-show="message"]', { timeout: 10000 })
.should('not.have.class', 'ng-hide')
.and('contain', 'Deposit Successful');

cy.get('div.center').should('contain', '5196');

cy.contains('Withdraw').click();
cy.get('input[placeholder="amount"]').type('100');
cy.contains('Withdraw').click();

cy.get('span.error.ng-binding[ng-show="message"]', { timeout: 10000 })
.should('not.have.class', 'ng-hide')
.and('be.visible')
.and('contain', 'Transaction successful');

cy.get('strong.ng-binding').eq(1).should('contain', '5096');

cy.contains('Transactions').click();

cy.contains('Back').should('be.visible').click();

cy.get('select').select('1002');

cy.contains('Transactions').click();
cy.get('tbody tr').should('have.length', 0);

cy.contains('Logout').should('be.visible').click();
});
});
Loading

0 comments on commit a9aef89

Please sign in to comment.