Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added "Customize Cookies" Banner, Added Session-Only Cookies Functionality, and Added Test Suite #84

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

Abhird11
Copy link

@Abhird11 Abhird11 commented May 3, 2024

Significant changes were made to improve functionality.

Banner Functionality

  • Added an option for "Customize Cookies" button which can open a new banner with a list of cookie options. The developer can add a new cookie script for any of these options.
  • Added an option for a "Close" Button, which shows up as an x in the top left of the banner. This button will just close the element and leave all cookies as is.
  • Added an option for session-only cookies, and another option to determine how long the cookie should last.
  • Added an additional customization option for shadow color and size for the banner.

Test Suite

Added a comprehensive test suite (GlowCookiesTest.js)

In the GlowCookiesTest class, there is a combinatorial tester. This will simulate user clicks by calling different methods in the GlowCookies class, and ensure that the cookies exist or don't exist. There are several example tests already provided, but it is easy to add additional tests.

There is also a Fuzzer in the GlowCookiesTest class. This will create a new GlowCookies object with completely random parameters. The setProbability parameter of the fuzzer determines the chance that each parameter gets set to a random value rather than the default one, and the numTests parameter determines the number of these random objects to create and see if any errors are created. This can be combined with the combinatorial tester above by creating many of these GlowCookies objects, then simulating the user doing several actions through this banner.

Other

Updated "Watch Demo" link. This may need to updated to link to the original GitHub page, but it does not exist currently. A new page must be created to make it fully functional. It uses the index.html page in the src code, and addCookies.js is used for the demo.

Updated README to include all updated changes.

Abhird11 and others added 22 commits March 10, 2024 03:34
This includes a completely new button that allows more in-depth cookie selection. Previously, you could only accept all or reject all, but now you are able to specify what specifically you want to accept or reject using different switches. More customization options coming soon to this for styling and such.
Customizer would pop up when first entering the site because it wasn't set to display: none on the default case.
- added support for session only cookies
- added index.html to create the object and view it
- added addcookie.js to add cookies for the demo
Session only cookies is now the fourth switch in the cookie customizer. Upon saving this selection, it either activates or deactivates sessiononly cookies. Test suite is now stand alone class that can be used on the overall GlowCookies class. Combinatorial testing class has also been updated so it can create combinations of multiple types.
For the customization options, you can now change the width of the main cookies banner as necessary. Additionally, you can dynamically add new switches to the cookie customizer. Lastly, moved all the tests into one test class and refactored as necessary and added additional default testing/
Added a couple new tests, and added comments for the GlowCookiesTester class
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