Advertisement
Guest User

Untitled

a guest
Aug 17th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. //// Cypress Alert System Issue
  2. it("C1395 Verify that you can create, edit & delete Repos under the Org", () => {
  3. cy.server();
  4. const stub = cy.stub()
  5. cy.on('window:alert', stub)
  6. cy.window().then((win) => {
  7. //cy.stub(win, 'alert').returns('brand-new-repo')
  8. cy.stub(win, 'alert').returns('delete')
  9. })
  10.  
  11. cy.route('GET', '/enzi/v0/accounts/org/admin').as('orgAdmin');
  12. cy.route('GET', '/enzi/v0/accounts/org/admin/organizations').as('organizations');
  13. cy.route('POST', '/api/v0/repositories/cypress-org').as('addRepo');
  14. cy.route('PATCH', '/api/v0/repositories/cypress-org/brand-new-repo').as('updateInfo');
  15.  
  16. cy.deleteRepo('cypress-org', 'brand-new-repo')
  17. cy.visit('repositories/new')
  18. cy.get('.Select-value').click();
  19. cy.get('.Select-option').contains('cypress-org').click();
  20. cy.get('[placeholder=name]').type('brand-new-repo');
  21. cy.get('button').contains('Create').click();
  22. cy.wait(['@orgAdmin', '@organizations', '@addRepo']);
  23. cy.wait(15000);
  24. cy.visit('/repositories/cypress-org/brand-new-repo/settings')
  25. cy.contains('Private').click()
  26. cy.contains('Save').click()
  27. cy.wait('@updateInfo')
  28. .should(resp => {
  29. expect(resp.response.body.visibility).eq('private');
  30. });
  31. cy.get('button').contains('Delete').click()
  32. .then((inp) => {
  33. expect(stub.getCall(0)).to.be.calledWith('delete')
  34. })
  35. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement