Skip to content

Conversation

@poush
Copy link
Contributor

@poush poush commented Mar 4, 2018

Work in progress for #75

@marco-c Sorry for delay! I was busy in exams. So, till now what I have done is creating a class for setting up the selenium drivers and provided a sample use of it though one test case. I would like to know if this is good method or there are some changes can be made to make it better. If it looks good then other possible functions can be added easily.

@@ -0,0 +1,41 @@
import os
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@marco-c Can we have a separate library for driver which can be used in test cases as well as in actual crawler ?

Copy link
Owner

Choose a reason for hiding this comment

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

Definitely, you can put it in autowebcompat.

@marco-c
Copy link
Owner

marco-c commented Mar 5, 2018

@marco-c Sorry for delay! I was busy in exams. So, till now what I have done is creating a class for setting up the selenium drivers and provided a sample use of it though one test case. I would like to know if this is good method or there are some changes can be made to make it better. If it looks good then other possible functions can be added easily.

Yes, the approach looks good to me overall!

Copy link
Owner

@marco-c marco-c left a comment

Choose a reason for hiding this comment

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

Marked as "changes needed" since it is a WIP.

@marco-c marco-c changed the title adding crawler functions to testing [wip] [WIP] adding crawler functions to testing Mar 8, 2018
@poush poush force-pushed the fix75 branch 3 times, most recently from 089fa47 to c95387a Compare March 14, 2018 12:14
@codecov-io
Copy link

codecov-io commented Mar 14, 2018

Codecov Report

Merging #103 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #103   +/-   ##
=======================================
  Coverage   18.95%   18.95%           
=======================================
  Files          16       16           
  Lines        1931     1931           
  Branches      328      328           
=======================================
  Hits          366      366           
  Misses       1562     1562           
  Partials        3        3

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 96348a2...fc30dbe. Read the comment docs.

@@ -0,0 +1,18 @@
from selenium.common.exceptions import NoAlertPresentException, NoSuchWindowException
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@marco-c What do you suggest for the file this file's name? or it is good to move this function to utilis.py

Copy link
Owner

Choose a reason for hiding this comment

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

I think crawler.py is OK.

@poush
Copy link
Contributor Author

poush commented Mar 14, 2018

@marco-c Also, can I break up the task of adding tests cases? So taking the changes done in PR as one part and rest is completed by creating issues or it should be better if it completes in one PR?

@marco-c
Copy link
Owner

marco-c commented Mar 14, 2018

@marco-c Also, can I break up the task of adding tests cases? So taking the changes done in PR as one part and rest is completed by creating issues or it should be better if it completes in one PR?

Sure, please file an issue for anything that should be tested that is not covered in this PR.

@marco-c
Copy link
Owner

marco-c commented Mar 29, 2018

@poush do you still intend to work on this?

@marco-c
Copy link
Owner

marco-c commented Apr 11, 2018

Closing for lack of response. Feel free to reopen if you still intend to work on this in the future.

@marco-c marco-c closed this Apr 11, 2018
@propr
Copy link

propr bot commented Apr 11, 2018

Please provide your feedback on this pull request here.

Privacy statement: We don't store any personal information such as your email address or name. We ask for GitHub authentication as an anonymous identifier to account for duplicate feedback entries and to see people specific preferences.

@poush
Copy link
Contributor Author

poush commented May 19, 2018

@marco-c can you please reopen it? I would like to continue on it.

@marco-c
Copy link
Owner

marco-c commented May 20, 2018

Sure!

different fixes

different fixes
@marco-c
Copy link
Owner

marco-c commented Jul 16, 2018

ping @poush

@poush
Copy link
Contributor Author

poush commented Jul 28, 2018

😅Got busy in my summer project. Give me a week or two. I will fix the travis issues.

@poush poush force-pushed the fix75 branch 2 times, most recently from d46ca3c to 5f7af1f Compare August 30, 2018 08:42
@poush
Copy link
Contributor Author

poush commented Aug 30, 2018

@marco-c test seems passing, please have a look. I will put into the issue what next methods will be covered in next PR.

marco-c
marco-c previously approved these changes Sep 6, 2018
Copy link
Owner

@marco-c marco-c left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks!
Just a few nits.

@poush
Copy link
Contributor Author

poush commented Oct 8, 2018

@marco-c Can you please check it again? I fixed all the reviews that same day.

Copy link
Owner

@marco-c marco-c left a comment

Choose a reason for hiding this comment

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

Oh sorry, I hadn't realized you fixed the nits! Please tell me whenever you make changes to the PR, as it looks like GitHub doesn't notify me when you add more commits.

BTW, the patch looks good again, but there are a few arguments that are missing for the driver.

chrome_options.add_argument('--headless')
chrome_options.add_argument('--window-size=412,732')
chrome_options.add_argument(
'--user-agent=Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5 Build/M4B30Z) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Mobile Safari/537.36')
Copy link
Owner

Choose a reason for hiding this comment

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

It looks like some arguments are missing here.

chrome_bin = 'tools\\Google\\Chrome\\Application\\chrome.exe'
nightly_bin = 'tools\\Nightly\\firefox.exe'
else:
chrome_bin = nightly_bin = None
Copy link
Owner

Choose a reason for hiding this comment

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

Let's throw an exception here, as this should never happen.

def setup_method(self):
self.driver = Driver()

def teardown_method(self):
Copy link
Owner

Choose a reason for hiding this comment

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

Nit: I think you can remove this function if it's not doing anything.

chrome_bin, nightly_bin = utils.get_browser_bin()
assert isinstance(chrome_bin, str)
assert isinstance(nightly_bin, str)
assert os.path.exists(os.path.join(os.path.abspath('./'), chrome_bin))
Copy link
Owner

Choose a reason for hiding this comment

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

Nit: I wonder if you can't just do assert os.path.exists(chrome_bin).

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.

3 participants