Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding tests for Record view, request file, search #1488

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SarahBA
Copy link
Contributor

@SarahBA SarahBA commented Jun 19, 2017

No description provided.

@@ -3,7 +3,7 @@ import Nightmare from 'nightmare';
jasmine.DEFAULT_TIMEOUT_INTERVAL=20*1000;

export const nightmareConfig = {
// show: true,
show: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep show: true for debugging only

await login(page);
// page.end();
} catch(e){
console.error(e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please keep the indentation here consistent


await assertElementText(page, '#header-navbar-collapse > .user > li > a', USER_EMAIL);
describe('User profile', function () {
test('user can navigate to the profile page', async function() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation error

let page = Nightmare(nightmareConfig).goto(B2SHARE_URL+'/records/47077e3c4b9f4852a40709e338ad4620');

await page.wait('.col-lg-6 .well .col-sm-12.list-unstyled li .col-sm-8') //Open Access
.evaluate(function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a function for this pattern would be more readable (see assertElementText)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I tried to use it, but most of the time it doesn't find the element :/ I know, doesn't make sense!

});

// Should move it after creating a new record with restrict access!
// describe('A restricted published record', function () {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented this test for now, because there is no restricted record in the demo.


// await expect(page.url() == B2SHARE_URL+'/records/47077e3c4b9f4852a40709e338ad4620/abuse');

// await page.click(' .form-horizontal .row .col-sm-1 > #abusecontent ') //checked
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't find the radio button, can you please take a look? @emanueldima

@SarahBA
Copy link
Contributor Author

SarahBA commented Jun 21, 2017

I just added the 'in progress' label because the tests don't run consistently on my system. Can you please try running them and check how it is on your side? @emanueldima

@emanueldima
Copy link
Contributor

emanueldima commented Jun 21, 2017

This is my result:

Test Suites: 3 failed, 3 total
Tests:       6 failed, 2 passed, 8 total
Snapshots:   0 total
Time:        80.849s, estimated 81s

I'll try to debug this while you're on holidays.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants