Skip to content

Commit

Permalink
e2e: added read tree tests to add github, gitlab and azure read URLs
Browse files Browse the repository at this point in the history
Signed-off-by: blam <ben@blam.sh>
  • Loading branch information
benjdlambert committed Apr 23, 2021
1 parent 382531e commit 6f015b7
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 16 deletions.
2 changes: 1 addition & 1 deletion cypress/cypress.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"baseUrl": "http://localhost:3000",
"baseUrl": "http://localhost:7000",
"integrationFolder": "./src/integration",
"supportFile": "./src/support",
"fixturesFolder": "./src/fixures",
Expand Down
56 changes: 41 additions & 15 deletions cypress/src/integration/integrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,59 @@ import 'os';

describe('Integrations', () => {
describe('ReadTree', () => {
// it('should work for azure', () => {
// cy.loginAsGuest();
it('should work for github', () => {
cy.loginAsGuest();

// cy.visit('/catalog-import');
cy.request('POST', '/api/catalog/locations', {
target:
'https://github.com/backstage-verification/test-repo/blob/main/**/*',
type: 'url',
});

// cy.get('input[name=url]').type(
// 'https://dev.azure.com/backstage-verification/_git/test-repo?path=%2Fnested%2F*',
// );
cy.visit('/catalog');
cy.contains('All').click();
cy.get('table').should('contain', 'github-repo');
cy.get('table').should('contain', 'github-repo-nested');
});

// cy.contains('Analyze').click();
// it('should work for azure', () => {
// cy.loginAsGuest();

// cy.request('POST', '/api/catalog/locations', {
// target:
// 'https://dev.azure.com/backstage-verification/_git/test-repo?path=*',
// type: 'url',
// });
// });

it('should work for github', () => {
it('should work for gitlab', () => {
cy.loginAsGuest();

cy.visit('/catalog-import');
cy.request('POST', '/api/catalog/locations', {
target:
'https://gitlab.com/backstage-verification/test-repo/-/tree/master/**/*',
type: 'url',
});

cy.visit('/catalog');
cy.contains('All').click();
cy.get('table').should('contain', 'gitlab-repo');
cy.get('table').should('contain', 'gitlab-repo-nested');
});

cy.get('input[name=url]').type(
'https://github.com/backstage-verification/test-repo',
);
cy.request('/api/catalog/locations', {
it('should work for bitbucket', () => {
cy.loginAsGuest();

cy.request('POST', '/api/catalog/locations', {
target:
'https://github.com/backstage-verification/test-repo/blob/main/**/*',
'https://bitbucket.org/backstage-verification/test-repo/src/master/**/*',
type: 'url',
});

cy.contains('Analyze').click();
cy.visit('/catalog');
cy.contains('All').click();
cy.get('table').should('contain', 'bitbucket-repo');
cy.get('table').should('contain', 'bitbucket-repo-nested');
});
});
});

0 comments on commit 6f015b7

Please sign in to comment.