aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2018-02-04submit_week_for_approval: Fix page load waiter; Click confirm buttonTeddy Wing
Instead of waiting on an "invisible" `<script>` tag that Selenium doesn't know how to do, check that the "week" page is loaded a different way: by checking that the year appears in the header and the day appears in a column header. Uncomment the rest of the function. We weren't clicking the confirmation button (`.approval-confirmation`). Added a `click()` call there.
2018-02-04submit_week_for_approval: Figured out how to get text from `<script>`Teddy Wing
Just saving this because it works, which is neat. Unfortunately, I can't use it in a Selenium wait expectation because it doesn't allow me to compare arbitrary strings. I have to speak its language, with elements and contents etc. This answer showed me how to do this: https://stackoverflow.com/questions/20497607/how-to-get-the-contents-of-a-script-tag-in-selenium/20498102#20498102
2018-02-04Draft of submitting week for approvalTeddy Wing
First pass, doesn't work yet. This will determine last Friday's date and visit the page corresponding to that week. It will then try to submit that week's timesheet. The `wait` on the `script` tag contents waiting for the "week" page to load isn't working. Looks like you can't wait on the contents of a `<script>` tag. Moved the `wait` variable outside of `login` so it can be used in `submit_week_for_approval`.
2018-02-04Replace the sleep with a `wait`Teddy Wing
Wait until an element from the logged-in page is found before finishing or moving on from login.
2018-02-04Add .gitignoreTeddy Wing
Ignore the Python virtualenv/venv directory.
2018-02-04Add harvester_submit_week_for_approval.pyTeddy Wing
The start of a script that will log into Harvest via the normal web interface and submit the most recent full week's time sheet for approval. It uses Selenium and the Firefox WebDriver. It works with the `-headless` option, but I've commented that out for testing. Right now, it can open the Harvest sign-in page and log in.