Html report like artifact on the github actions....
** Note: Only behind docker selenium/standalone-chrome can check if extension is installed because of Problems founded
DEMO: https://drive.google.com/file/d/1T3NkvHAzH-PkFTWoCPY4ttRlD7lT2VgQ/view?usp=sharing
python3.8 -m venv .env
source .env/bin/activate # or .env/Scripts/activate on win
pip install -r requirements.txt
pytest --grammarly-ext utils/grammarly.14.1006.0.crx # for run with grammarly installed
# or
pytest -k no_installed # for run without grammarly installed
I had to go to the extension directory:
on windows:
f"/mnt/c/Users/{user}/AppData/Local/Google/Chrome/User Data/{profile_name}/Extensions/{extension_id}"
Then i had to inspect the definition extension of the grammarly manifest.json
Find files loaded at start. Then inspect that js..
I discover src/js/Grammarly-check.js
that's mean: "OK if check maybe there is the definition of loaded or installed"
With js-beautify
unminificate the code and inspect the functions and found:
When the plugin is loaded there are some data-
properties attached to the <body>
tag.
- When you run on docker-selenium webdriver=remote, the application upload the file crx, then selenium cann't handle it and raise a java heap memory exception.. I don't fix it because are out scope of the project.
- Install chrome extension with selenium https://github.com/zodman/test-grammarly/blob/main/conftest.py#L17
- get html nodes from Shadow DOM https://github.com/zodman/test-grammarly/blob/main/tests/utils.py#L4