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

[test] Add tests which convert from issues #6356

Closed
wants to merge 1 commit into from
Closed

[test] Add tests which convert from issues #6356

wants to merge 1 commit into from

Conversation


driver = webdriver.Chrome(executable_path=os.environ['CHROMEDRIVER'], chrome_options=chrome_options)
driver.implicitly_wait(2)
time.sleep(20)
Copy link
Member

Choose a reason for hiding this comment

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

Please remove such sleep calls. It will slow down running tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed all unnecessary sleep calls. PTAL

print 'start to debug line 16 via breakpoint'
for i in range(10):
print "click Resume script execution button: %s" % i
time.sleep(5)
Copy link
Member

Choose a reason for hiding this comment

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

Here is the example of more sleep calls. Please remove them or replace it with a loop like this: https://github.com/nwjs/nw.js/blob/nw27/test/sanity/nw_util.py#L103

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Replaced the sleep call following the example that your mentioned. But for waiting for crash tests, this method seems not a good choose, do you have any better solution?

Copy link
Member

Choose a reason for hiding this comment

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

which test do you mean?

print 'switch to devtools'
switch_to_devtools(driver, None, True)
print 'waiting for crash'
time.sleep(5)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rogerwang just like this, I need to set the time waiting for crash.

Copy link
Member

Choose a reason for hiding this comment

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

this case is special and it is ok to sleep 5 seconds to make sure there is no crash in this period.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, if there is no other question, could you please merge this PR? Thanks a lot.

@rogerwang
Copy link
Member

Could you please verify for each case, it will fail with the NW.js version before it was fixed? This would help to verify the case is effective. The version in which bugs were fixed can be found in the CHANGELOG.

@wanghongjuan
Copy link
Contributor Author

OK, I will verify them again with latest release SDK on MacOS, Ubuntu and Windows.

@rogerwang
Copy link
Member

rogerwang commented Jan 8, 2018 via email

@wanghongjuan
Copy link
Contributor Author

All tests are verified with the failed NW.js version, except #5882 and #5943.

<body>
<h3 id="result">success</h3>
<script>
chrome.downloads.download({ url: "http://releases.ubuntu.com/xenial/ubuntu-16.04.3-desktop-amd64.iso" });
Copy link
Member

Choose a reason for hiding this comment

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

I think this could lead to full disk on the test machine?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

given enough time the disk should be still full. The correct way is to find where will the download be and remove them after the test is done.

@rogerwang
Copy link
Member

btw, you could consider to submit multiple PRs to nw28 for each of the test. So the good ones can be merged first.

@wanghongjuan
Copy link
Contributor Author

Thanks for your advice, I will submit the test one by one from next PR.

sys.exit(0)
#if platform.system() != 'Darwin':
# print 'Skipped for non Mac platform'
# sys.exit(0)

Copy link
Member

Choose a reason for hiding this comment

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

Why did you modify this case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, that's a mistake, recovered it.

- Add tests for issues: #6143 #6113 #6001 #5980 #5943 #5882 #6231
  #6229 #6171 #6099, totally 10 tests.

- Tested on linux, Windows 10 and MacOS, all of them are passed.
@wanghongjuan
Copy link
Contributor Author

Submitted new PRs for these issues, close this one

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

Successfully merging this pull request may close these issues.

2 participants