- Python
- Selenium
- Code Editor e.g. Vs Code
Depending on the version of python your have you can either install it via : for python version 2 pip install selenium
for python version 3 pip3 install selenium
. (Selenium Documentation)
-
Check your Chrome browser version ( help > About Google Chrome ).
-
Navigate to chromium drivers.
-
Select the particular driver version that is similar to your chrome version.
-
Move to a shared folder :
sudo mv chromedriver /usr/local/share/chromedriver
-
Link to your bin directory and afterwards confirm if successful by printing out the version of your chromedriver :
- Create folder , cd to the folder .
- Create two python files , secrets.py and appcreate.py
- Launch Github on browser and create repository for it.
- On terminal run : touch .gitignore && echo 'secrets.py' >> .gitignore this command will allow you not to push your secrets.py file to git as it will contain your credentials.
- Proceed with the respective git commands to push the project to github repo.
- Proceed to Coding :
-
secrets.py
Will contain your email address, passowrd and Personal Access Token ( i created one for each project type ) -
createapp.py
Will contain your operations :
- User to Select which type of app to build
- create directory of particular app in respective project type directory
- Launch Github
- create new repository
- intialize project locally
- commit and push project to github repo
- done
The implementation runs cases of VueJS | Flutter | Ardunio updates will be made on the Android and Arduino sections.
Thank you and Happy automation.
Instances When github request otp input we request user to input otp on terminal and proceed with operation.
def githubAccountVerfication(driver):
print("\n******************** ENTER GITHUB OTP ********************\n")
githubOTPCode = driver.find_element(By.XPATH, '//*[@id="otp"]')
if(githubOTPCode != None):
gitOtp = input("Input your OTP code : ")
githubOTPCode.send_keys(gitOtp)
githubOTPButton = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH,'//*[@id="login"]/div[3]/form/button')))
githubOTPButton.click()
else:
print("Proceeding to github repo creation ....")
print("\n**********************************************************\n")