Skip to content

Commit

Permalink
Merge branch 'master' into utk_react_bootstrap_v2
Browse files Browse the repository at this point in the history
  • Loading branch information
utku-ozturk committed Sep 15, 2024
2 parents 674fbfb + a5ec62a commit 75083fd
Show file tree
Hide file tree
Showing 11 changed files with 119 additions and 96 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ fourfront
Change Log
----------

8.1.3
=====

* Added disease_name property to experiment set schema.


8.1.2
=====

* New value "fragments" added in ignored_enum for processed file schema.


8.1.1
=====

Expand Down
11 changes: 11 additions & 0 deletions deploy/post_deploy_testing/cypress/e2e/01b_static_content.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ describe('Static Page & Content Tests', function () {
it('Click & visit each page from menu, ensure ToC exists somewhere, ensure ToC works.', function(){

cy.on('uncaught:exception', function(err, runnable){
// TODO: Investigate hydration errors occurring during SSR in Cypress tests.
// It appears that Cypress injects a prop into the div on the client side, which doesn't exist on the server side, leading to hydration issues.
// This suppression is temporary and should be removed once the issue is resolved.
// https://github.com/cypress-io/cypress/issues/27204
if (
/hydrat/i.test(err.message) ||
/Minified React error #418/.test(err.message) ||
/Minified React error #423/.test(err.message)
) {
return false;
}

expect(err.message).to.include("return response;");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ describe('Browse Views - Basic Tests', function () {
it('Select a grouping term in Experiment Type facet, then check whether the sub-terms are also selected', function () {

cy.visit('/browse').get('#slow-load-container').should('not.have.class', 'visible').end()
.get('.facet-charts.loading').should('not.exist')
.get(".facets-header .facets-title").should('have.text', 'Included Properties').end()
.get('.facet.closed[data-field="experiments_in_set.experiment_type.display_title"] > h5').scrollIntoView().should('be.visible').click().end()
.get('.facet.open[data-field="experiments_in_set.experiment_type.display_title"] .facet-list-element[data-is-grouping="true"] a').first().within(($term) => {
Expand Down Expand Up @@ -118,6 +119,7 @@ describe('Browse Views - Basic Tests', function () {
it('Exclude a grouping term in Experiment Type facet, then check whether the sub-terms are also excluded', function () {

cy.visit('/browse').get('#slow-load-container').should('not.have.class', 'visible').end()
.get('.facet-charts.loading').should('not.exist')
.get(".facets-header button").first().click().end()
.get(".facets-header .facets-title").should('have.text', 'Excluded Properties').end()
.get('.facet.closed[data-field="experiments_in_set.experiment_type.display_title"] > h5').scrollIntoView().should('be.visible').click().end()
Expand Down
162 changes: 73 additions & 89 deletions deploy/post_deploy_testing/cypress/e2e/04a_search_views_local.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,7 @@ describe('Deployment/CI Search View Tests', function () {
it('Check microscope configuration\'s hardware summary table', function () {
cy.visit('/search/?type=MicroscopeConfiguration&status=released').end();

let intervalCount = null;
cy.searchPageTotalResultCount().then((totalCountExpected) => {
intervalCount = Math.min(0, parseInt(totalCountExpected / 3));
});

cy.scrollToBottom().then(() => {
cy.get('.search-results-container .search-result-row[data-row-number="' + intervalCount + '"] .search-result-column-block[data-field="display_title"] a').click({ force: true }).end();
}).end();
cy.get('.search-results-container .search-result-row[data-row-number="0"] .search-result-column-block[data-field="display_title"] a').click({ force: true }).end();

cy.window().then(function (w) {
let currPagePath = "/";
Expand All @@ -244,106 +237,97 @@ describe('Deployment/CI Search View Tests', function () {
console.log(currPagePath);
}).end()
.get('h1.page-title').should('not.be.empty').end()
.get('div.rc-tabs span[data-tab-key="hardware-summary"]').should('contain', 'Hardware Summary');

let currTabTitle = null;
cy.get("h3.tab-section-title, h4.tab-section-title").first().then(function ($tabTitle) {
currTabTitle = $tabTitle.text();
}).end(); cy.get('.rc-tabs .rc-tabs-nav div.rc-tabs-tab:not(.rc-tabs-tab-active):not(.rc-tabs-tab-disabled)').each(function ($tab) {
cy.get('h1.page-title').should('not.be.empty').end().get('.rc-tabs-nav-scroll .rc-tabs-nav.rc-tabs-nav-animated .rc-tabs-tab-active.rc-tabs-tab').each(function ($tab) {
const tabKey = $tab.children('span.tab').attr('data-tab-key');
let termCount = null;
let termName = null;
let facetTotalCount = null;
const nextButtonItems = [];
const backButtonItems = [];
if (tabKey === 'hardware-summary') {
cy.wrap($tab).click({ 'force': true }).end();
let facetItemIndex = 1;
cy.get(".facets-body div.facet:not([data-field=''])").then(function ($facetTotalCount) {
facetTotalCount = $facetTotalCount.length;
facetItemIndex = Math.min(1, parseInt(facetTotalCount / 3));
});
cy.get(".facets-body div.facet:not([data-field='']):nth-child(" + facetItemIndex + ") > h5").scrollToCenterElement().click({ force: true }).end()
.get(".facet.open .facet-list-element a.term .facet-count").first().then(function ($facetCountFile) {
termCount = parseInt($facetCountFile.text());
})
.get(".facet.open .facet-list-element a.term .facet-item").first().then(function ($facetTextFile) {
termName = $facetTextFile.text();
})
.get(".row.summary-header .col.summary-title-column.text-truncate .summary-title").first().then(function ($tabFile) {
const tabFile = $tabFile.text().trim();
var regExp = /Component Summary Table - (.*) \((\d*)\)/g;
const regexCheck = regExp.exec(tabFile);
cy.expect(termName).equal(regexCheck[1]);
cy.expect(parseInt(termCount)).equal(parseInt(regexCheck[2]));
if (termCount > 3) {
//Next Button
.get('div#microscopy-app-container .droptarget p').contains('Microscope Name').end()
.get('div.rc-tabs span[data-tab-key="hardware-summary"]').should('contain', 'Hardware Summary').end();

cy.get('h1.page-title').should('not.be.empty').end().get('.rc-tabs-nav-scroll .rc-tabs-nav.rc-tabs-nav-animated .rc-tabs-tab span.tab[data-tab-key="hardware-summary"]:first-child').then(function ($tab) {
let termCount = null;
let termName = null;
let facetTotalCount = null;
const nextButtonItems = [];
const backButtonItems = [];
//get parent to click
cy.wrap($tab).parent().should('have.class', 'rc-tabs-tab').wait(1000).click({ force: true }).end();
let facetItemIndex = 1;
cy.get(".facets-body div.facet:not([data-field=''])").then(function ($facetTotalCount) {
facetTotalCount = $facetTotalCount.length;
facetItemIndex = Math.min(1, parseInt(facetTotalCount / 3));
});
cy.get(".facets-body div.facet:not([data-field='']):nth-child(" + facetItemIndex + ") > h5").scrollToCenterElement().click({ force: true }).end()
.get(".facet.open .facet-list-element a.term .facet-count").first().then(function ($facetCountFile) {
termCount = parseInt($facetCountFile.text());
})
.get(".facet.open .facet-list-element a.term .facet-item").first().then(function ($facetTextFile) {
termName = $facetTextFile.text();
})
.get(".row.summary-header .col.summary-title-column.text-truncate .summary-title").first().then(function ($tabFile) {
const tabFile = $tabFile.text().trim();
var regExp = /Component Summary Table - (.*) \((\d*)\)/g;
const regexCheck = regExp.exec(tabFile);
cy.expect(termName).equal(regexCheck[1]);
cy.expect(parseInt(termCount)).equal(parseInt(regexCheck[2]));
if (termCount > 3) {
//Next Button
cy.get('.row.summary-sub-header .summary-title-column.text-truncate').then(function ($totalHeader) {
Cypress._.forEach($totalHeader, function (block) {
const item = (Cypress.$(block).text());
if ((item.trim() !== 'MetaData') || (item !== "")) {
nextButtonItems.push((Cypress.$(block).text()));
}
});
const totalCount = (termCount - nextButtonItems.length);
for (let i = 0; i <= totalCount; i++) {
cy.get('.prev-next-button-container [data-tip="Show next component"]').parent().click().end();
cy.get('.row.summary-sub-header .summary-title-column.text-truncate').then(function ($totalHeader) {
Cypress._.forEach($totalHeader, function (block) {
const item = (Cypress.$(block).text());
if ((item.trim() !== 'MetaData') || (item !== "")) {
nextButtonItems.push((Cypress.$(block).text()));
}
});
const totalCount = (termCount - nextButtonItems.length);
for (let i = 0; i <= totalCount; i++) {
cy.get('.prev-next-button-container [data-tip="Show next component"]').parent().click().end();
cy.get('.row.summary-sub-header .summary-title-column.text-truncate').then(function ($totalHeader) {
Cypress._.forEach($totalHeader, function (block) {
const item = (Cypress.$(block).text());
if ((item.trim() !== 'MetaData') || (item !== "")) {
nextButtonItems.push((Cypress.$(block).text()));
}
});
if (i == totalCount) {
const itemsCount = _.uniq(nextButtonItems);
cy.expect(itemsCount.length - 1).equal(termCount);
}
}).end();
if (i == totalCount) {
const itemsCount = _.uniq(nextButtonItems);
cy.expect(itemsCount.length - 1).equal(termCount);
}
});
//Previous Button
}).end();
}
});
//Previous Button
cy.get('.row.summary-sub-header .summary-title-column.text-truncate').then(function ($totalHeader) {
Cypress._.forEach($totalHeader, function (block) {
const item = (Cypress.$(block).text());
if ((item.trim() !== 'MetaData') || (item !== "")) {
backButtonItems.push((Cypress.$(block).text()));
}
});
const totalCount = (termCount - backButtonItems.length);
for (let i = 0; i <= totalCount; i++) {
cy.get('.prev-next-button-container [data-tip="Show previous component"]').parent().click().end();
cy.get('.row.summary-sub-header .summary-title-column.text-truncate').then(function ($totalHeader) {
Cypress._.forEach($totalHeader, function (block) {
const item = (Cypress.$(block).text());
if ((item.trim() !== 'MetaData') || (item !== "")) {
backButtonItems.push((Cypress.$(block).text()));
}
});
const totalCount = (termCount - backButtonItems.length);
for (let i = 0; i <= totalCount; i++) {
cy.get('.prev-next-button-container [data-tip="Show previous component"]').parent().click().end();
cy.get('.row.summary-sub-header .summary-title-column.text-truncate').then(function ($totalHeader) {
Cypress._.forEach($totalHeader, function (block) {
const item = (Cypress.$(block).text());
if ((item.trim() !== 'MetaData') || (item !== "")) {
backButtonItems.push((Cypress.$(block).text()));
}
});
if (i == totalCount) {
const itemsCount = _.uniq(backButtonItems);
cy.expect(itemsCount.length - 1).equal(termCount);
}
}).end();
if (i == totalCount) {
const itemsCount = _.uniq(backButtonItems);
cy.expect(itemsCount.length - 1).equal(termCount);
}
});
}).end();
}
else{
cy.get('.row.summary-sub-header .summary-title-column.text-truncate').then(function ($totalHeader) {
const headerCount = $totalHeader.length - 1;
cy.expect(headerCount).equal(termCount);
});
}
}).end();
}

}).end();
cy.wrap($tab).click({ 'force': true }).end()
.get('.rc-tabs-content .rc-tabs-tabpane-active');
});
}
else {
cy.get('.row.summary-sub-header .summary-title-column.text-truncate').then(function ($totalHeader) {
const headerCount = $totalHeader.length - 1;
cy.expect(headerCount).equal(termCount);
});
}
}).end();

}).end();
}).end();
});
});

});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('Biosample create page', function () {
expect(accountListItem.text()).to.contain('Cypress');
}).end();
cy.visit('/search/?type=Biosample').get(".above-results-table-row .btn").should('contain', 'Create New')
.get("a.btn.btn-primary.btn").should('contain', 'Create New').click().end()
.get("a.btn.btn-primary.btn").should('contain', 'Create New').click({ 'force': true }).end()
.get('.submission-view-modal .modal-title').should('have.text', 'Give your new Biosample an alias');

// Submit create biosample data name
Expand All @@ -44,7 +44,7 @@ describe('Biosample create page', function () {
cy.get("@editButtons").find('button.btn').contains('Validate').click().end();
cy.get("@editButtons").find('button.btn').contains('Submit').click().end();
cy.get("@editButtons").find('button.btn').contains('Skip').click().end();
cy.get("h1.page-title").should('contain', "Biosample").end(); // Await until are at Biosample page. Then wait 1s to ensure we have new context.
cy.get(".indicator-item.item-status").should('contain', "in review by lab").end(); // Await until are at Biosample page. Then wait 1s to ensure we have new context.

// Queue for deletion in subsequent test.
cy.get('script[data-prop-name=context]').then(function($context){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ describe('Processed/Raw/Supplementary Files - Counts', function () {
accession = $accesionText.text();
});

cy.get('.embedded-search-view-outer-container .result-table-row .title-block a').scrollIntoView().click({ force: 'true' }).then(function($linkElem){
cy.get('.embedded-search-view-outer-container .search-result-row[data-row-number="0"] .title-block a').scrollIntoView().click({ force: 'true' }).then(function($linkElem){
const [linkHref] = $linkElem.attr('href').split('#');
cy.location('pathname').should('equal', linkHref);

Expand Down
2 changes: 1 addition & 1 deletion deploy/post_deploy_testing/cypress/e2e/13_vitessce.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('Vitessce display page', function () {
.get('div.rc-tabs span[data-tab-key="file-vitessce"]').should('contain', 'Vitessce').end();
cy.get('div.rc-tabs span[data-tab-key="file-vitessce"]').click({ 'force': true }).end();
cy.get("h3.tab-section-title, h4.tab-section-title").should('contain.text', 'Vitessce Visualization').end();
cy.get('div.vit2 div.vit3').each(function ($title, index) {
cy.get('.vit-makeStyles-title .vit-makeStyles-titleLeft').each(function ($title, index) {
if (index === 0) {
expect($title[0].innerText).to.eql('Spatial');
} else if (index == 1) {
Expand Down
Loading

0 comments on commit 75083fd

Please sign in to comment.