Advertisement
Guest User

Untitled

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