Skip to content

Commit

Permalink
fix e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tsubik committed Nov 3, 2023
1 parent fd3e37e commit 13e2657
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 8 deletions.
1 change: 1 addition & 0 deletions components/operators/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class OperatorsFilters extends React.Component {
type="search"
placeholder={this.props.intl.formatMessage({ id: f.placeholder })}
className="search-input"
data-test-id={`search-input-${f.key}`}
value={filters[f.key]}
onChange={e => this.setSearch(e.currentTarget.value, f.key)}
/>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
11 changes: 8 additions & 3 deletions e2e/cypress/e2e/pages.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,17 @@ describe('Pages', () => {
})

it('displays content', function () {
cy.contains('Welcome to the Open Timber Portal. This document lets the user of these Services');
})
})

cy.contains('World Resources Institute Privacy Policy');
describe('Privacy policy page', () => {
beforeEach(() => {
cy.visit('http://localhost:4000/privacy-policy');
})

it('matches visually', function () {
cy.matchImage();
it('displays content', function () {
cy.contains('List of Cookies that May Be Set');
})
})

Expand Down
9 changes: 7 additions & 2 deletions e2e/cypress/e2e/transparency-ranking.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@ describe('Transparency ranking page', function () {

describe('filters', function () {
it('can filter by producer name', function () {
cy.get('.search-input').clear().type('lorem')
cy.get('[data-test-id=search-input-operator]').clear().type('lorem')
cy.get('.c-ranking table tbody').find('tr').should('have.length', 1);
})
});

it('can filter by fmu name', function () {
cy.get('[data-test-id=search-input-fmu]').clear().type('lopola')
cy.get('.c-table-expanded-row table tbody').find('tr').should('have.length', 1);
});
})
});
1 change: 0 additions & 1 deletion e2e/cypress/e2e/user.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ describe('User', () => {

cy.get('#input-name').type(`Super New Producer ${nanoid(6)}`);
cy.get('#input-details').type('Producer description');
cy.get('#select-locale .react-select__single-value').contains('English');
cy.selectOption('[name=operator_type]', 'E', 'Estate');
cy.get('#input-website').type('wrong website');
cy.get('#input-website').clear();
Expand Down
3 changes: 2 additions & 1 deletion e2e/cypress/support/exceptions.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Cypress.on('uncaught:exception', err => !err.message.includes('ResizeObserver loop limit exceeded'))
Cypress.on('uncaught:exception', err => !err.message.includes('ResizeObserver loop limit exceeded') &&
!err.message.includes('ResizeObserver loop completed with undelivered notifications'));
2 changes: 1 addition & 1 deletion e2e/restore-db.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

cd ../../db
./restore.sh test_db_backup.dump fti_api_cypress
./restore-test.sh test_db_backup.dump fti_api_cypress

cd ../otp-api
POSTGRES_DATABASE=fti_api_cypress bundle exec rails db:migrate

0 comments on commit 13e2657

Please sign in to comment.