Changeset View
Changeset View
Standalone View
Standalone View
cypress/integration/origin-browse.spec.js
/** | /** | ||||
* Copyright (C) 2020 The Software Heritage developers | * Copyright (C) 2020-2021 The Software Heritage developers | ||||
anlambert: 2020-2021 | |||||
* See the AUTHORS file at the top-level directory of this distribution | * See the AUTHORS file at the top-level directory of this distribution | ||||
* License: GNU Affero General Public License version 3, or any later version | * License: GNU Affero General Public License version 3, or any later version | ||||
* See top-level LICENSE file for more information | * See top-level LICENSE file for more information | ||||
*/ | */ | ||||
describe('Test origin browse', function() { | describe('Test origin browse', function() { | ||||
beforeEach(function() { | beforeEach(function() { | ||||
const url = `${this.Urls.browse_origin()}?origin_url=${this.origin[1].url}`; | const url = `${this.Urls.browse_origin()}?origin_url=${this.origin[1].url}`; | ||||
▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | it('should have the master branch in the list', function() { | ||||
cy.get('table').contains('td', 'master').should('be.visible'); | cy.get('table').contains('td', 'master').should('be.visible'); | ||||
}); | }); | ||||
it('should search inside the branches', function() { | it('should search inside the branches', function() { | ||||
cy.get('#swh-branch-search-string').type('mas'); | cy.get('#swh-branch-search-string').type('mas'); | ||||
cy.get('#swh-branch-serach-button').click(); | cy.get('#swh-branch-serach-button').click(); | ||||
cy.location('search') | cy.location('search') | ||||
.should('include', 'branch_name_include=mas'); | .should('include', 'name_include=mas'); | ||||
cy.get('table').contains('td', 'master').should('be.visible'); | cy.get('table').contains('td', 'master').should('be.visible'); | ||||
cy.get('#swh-branch-search-string').should('have.value', 'mas'); | cy.get('#swh-branch-search-string').should('have.value', 'mas'); | ||||
}); | }); | ||||
it('should empty search show all branches', function() { | it('should show all the branches for empty search', function() { | ||||
Not Done Inline Actionsshould show all branches for empty search anlambert: should show all branches for empty search | |||||
cy.get('#swh-branch-search-string').clear(); | cy.get('#swh-branch-search-string').clear(); | ||||
cy.get('#swh-branch-serach-button').click(); | cy.get('#swh-branch-serach-button').click(); | ||||
cy.location('search') | cy.location('search') | ||||
.should('include', 'branch_name_include='); | .should('include', 'name_include='); | ||||
cy.get('table').contains('td', 'master').should('be.visible'); | cy.get('table').contains('td', 'master').should('be.visible'); | ||||
cy.get('#swh-branch-search-string').should('have.value', ''); | cy.get('#swh-branch-search-string').should('have.value', ''); | ||||
}); | }); | ||||
it('should show no branch exists message on failed search', function() { | it('should show no branch exists message on failed search', function() { | ||||
cy.get('#swh-branch-search-string').type('random{enter}'); | cy.get('#swh-branch-search-string').type('random{enter}'); | ||||
cy.get('table').contains('td', 'No branch names containing random have been found!').should('be.visible'); | cy.get('table').contains('td', 'No branch names containing random have been found!').should('be.visible'); | ||||
}); | }); | ||||
}); | }); | ||||
describe('Test browse releases', function() { | |||||
beforeEach(function() { | |||||
const url = `${this.Urls.browse_origin_releases()}?origin_url=${this.origin[1].url}`; | |||||
cy.visit(url); | |||||
}); | |||||
it('should have the v2 release in the list', function() { | |||||
cy.get('table').contains('td', 'v2.0').should('be.visible'); | |||||
}); | |||||
it('should search inside the releases', function() { | |||||
cy.get('#swh-branch-search-string').type('v2.4'); | |||||
cy.get('#swh-branch-serach-button').click(); | |||||
cy.location('search') | |||||
.should('include', 'name_include=v2.4'); | |||||
cy.get('table').contains('td', 'v2.4').should('be.visible'); | |||||
cy.get('#swh-branch-search-string').should('have.value', 'v2.4'); | |||||
}); | |||||
Not Done Inline Actionsshould show all the releases for empty search anlambert: should show all the releases for empty search | |||||
it('should show all the releases for empty search', function() { | |||||
cy.get('#swh-branch-search-string').clear(); | |||||
cy.get('#swh-branch-serach-button').click(); | |||||
cy.location('search') | |||||
.should('include', 'name_include='); | |||||
cy.get('table').contains('td', 'v2.0').should('be.visible'); | |||||
cy.get('#swh-branch-search-string').should('have.value', ''); | |||||
}); | |||||
it('should show no release exists message on failed search', function() { | |||||
cy.get('#swh-branch-search-string').type('random{enter}'); | |||||
cy.get('table').contains('td', 'No release names containing random have been found!').should('be.visible'); | |||||
}); | |||||
}); |
2020-2021