What is happening
Well, things took a big turn, the Repo moderators responded today for the first time after Release 0.3 and they requested lot of changes as we know today is the last of classes and submission for Release 0.4, they is very small room for changes and waiting for them to merge as they live in a different time zone it will be too late.
What they have asked me to do
As there was a styling issue with blog post page This PR They have requested a change in this and also this PR which i created a mock page for creating a blog post, now they requested they need a google form, and finally this PR affects my latest Issue.
What i did
I was able to answer to everything they have asked me too, well was lot of stress at the last moment as all of my other subjects finished today and i want to get everything done. I have added or changed everything based on their request.
The second one which is the addition of an embedded Google Form for Blog Creation:
Lastly the updated test cases for google form: Little story about this was i was not sure that we will be able to write a test case for a google form, to my surprise we are able to, but a bit complicated.
Before everything there is a major concern with google form, as if we have a file upload in google form, google will prevent us from using it as an embedded format due to security issues. I have mentioned that to them no reply yet. Still i decided to make them a mock one with the test included.
So the test has has 3 major parts, Title section content section and the submit button section.
# Switch to the iframe containing the Google Form
iframe = driver.find_element(By.TAG_NAME, "iframe")
driver.switch_to.frame(iframe)
# Wait for the form to load
wait = WebDriverWait(driver, 10)
# Fill out the "Title" question
title_field = wait.until(
EC.presence_of_element_located((By.CSS_SELECTOR, 'input[aria-labelledby="i1 i4"]'))
)
title_field.send_keys("Sample Title")
# Fill out the "Content" question
content_field = wait.until(
EC.presence_of_element_located((By.CSS_SELECTOR, 'textarea[aria-labelledby="i6 i9"]'))
)
content_field.send_keys("This is a test content for the Google Form.")
# Submit the form
submit_button = wait.until(
EC.element_to_be_clickable((By.XPATH, '//span[contains(@class, "NPEfkd") and text()="Submit"]'))
)
submit_button.click()
So in this basically, we choose the frame of google form, which i called as iframe
and basically selecting everything with in but it is tricky we need to go and inspect each element and retrieve their aria-labelledby
id's in order to call that element to the test case. In my case it was two id's for the text input forms.
Another part is to find the submit message and the success message to ensure the form is submitted, it can be done by taking the element by passing the div and the class id's to the EC.presence_of_element_located
and it is located by XPATH
. With this we can make sure the google form is active and working as indented.
Concerns
I am pretty sure that they will merge my PR request, only thing is that it won't happen in the time that is given to me, I have tried to contact them multiple time via Discord and all of them were unavailable due to several reasons and also another major thing is about the time zone.
Conclusions
I will still contribute this Repo and help them to finish there work when they are back from their events and classes and i will work my way forward in finishing this issues and merging and closing my issues and PR's.
After all of this mishappenings i am still glad that i was able to contribute to a good cause and i have learned a lot during this course, Special thanks to my Professor David Humphrey and all of classmates it was a wonderful semester indeed.
LINKS:
REPO : https://github.com/computerclubkec/computerclubkec.github.io
PREVIEW : https://deploy-preview-159--dainty-scone-61e301.netlify.app
Top comments (0)