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

### Add Contribute section to homepage #4457

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
612e1e5
Create Test Cases
JasmanD18 May 22, 2024
a3472f6
Create test_authentication.py
JasmanD18 May 22, 2024
3c112e0
Create test_api_integration.py
JasmanD18 May 22, 2024
7ea74f9
Create test_security_vulnerabilities.py
JasmanD18 May 22, 2024
eed16fe
Create files
JasmanD18 May 22, 2024
7f6f440
Delete Tests/files
JasmanD18 May 22, 2024
0eb7892
Create test_authentication.py
JasmanD18 May 22, 2024
e0e337b
Delete Tests/unit_tests/test_authentication.py
JasmanD18 May 22, 2024
3a6f628
Create test_authentication.py
JasmanD18 May 22, 2024
ee69e01
Create test_api_integration.py
JasmanD18 May 22, 2024
ba57b58
Create test_security_vulnerabilities.py
JasmanD18 May 22, 2024
6a3f41c
Delete test_api_integration.py
JasmanD18 May 22, 2024
614b073
Delete test_authentication.py
JasmanD18 May 22, 2024
d8b3183
Delete test_security_vulnerabilities.py
JasmanD18 May 22, 2024
5fd69d3
Create test_suite.md
JasmanD18 May 22, 2024
f4e1e8f
Create usability_report.pdf
JasmanD18 May 22, 2024
139f9ce
Create inspection_report.pdf
JasmanD18 May 22, 2024
b3c25ec
Create test_game_functionality.py
JasmanD18 May 22, 2024
6e8714f
Create test_frontend_integration.py
JasmanD18 May 22, 2024
51e9727
Create vulnerability_report.md
JasmanD18 May 22, 2024
5d9a3c2
Update index.html
JasmanD18 May 27, 2024
fa356a7
Add Contribute section to homepage
JasmanD18 May 27, 2024
53a867a
Add Contribute section to homepage
JasmanD22 Jun 12, 2024
b779b4c
Merge branch 'add-contribute-section' of https://github.com/JasmanD18…
JasmanD18 Jun 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Test Cases
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/tests
/unit_tests
test_authentication.py
test_game_functionality.py
/integration_tests
test_api_integration.py
test_frontend_integration.py
/security_tests
test_security_vulnerabilities.py
14 changes: 14 additions & 0 deletions Tests/integration_tests/test_api_integration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import requests
import unittest

class TestAPIIntegration(unittest.TestCase):

def test_get_game_list(self):
# Test API endpoint for retrieving game list
response = requests.get('http://localhost:5000/api/games')
self.assertEqual(response.status_code, 200)
games = response.json()
self.assertTrue(len(games) > 0)

if __name__ == '__main__':
unittest.main()
22 changes: 22 additions & 0 deletions Tests/integration_tests/test_frontend_integration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import unittest
from selenium import webdriver

class TestFrontendIntegration(unittest.TestCase):

def setUp(self):
self.driver = webdriver.Chrome()
self.driver.get("http://localhost:8000")

def test_homepage_load(self):
self.assertEqual(self.driver.title, "GameZone - Home")

def test_game_page(self):
game_link = self.driver.find_element_by_link_text("Play Now")
game_link.click()
self.assertEqual(self.driver.current_url, "http://localhost:8000/game")

def tearDown(self):
self.driver.quit()

if __name__ == "__main__":
unittest.main()
14 changes: 14 additions & 0 deletions Tests/security_tests/test_security_vulnerabilities.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import unittest
import requests

class TestSecurityVulnerabilities(unittest.TestCase):

def test_sql_injection(self):
# Test for SQL Injection vulnerability
username = "' OR 1=1 --"
password = "any_password"
response = requests.post('http://localhost:5000/login', data={'username': username, 'password': password})
self.assertNotIn('Login successful', response.text)

if __name__ == '__main__':
unittest.main()
17 changes: 17 additions & 0 deletions Tests/unit_tests/test_authentication.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import unittest
from gamezone import authenticate_user

class TestAuthentication(unittest.TestCase):

def test_valid_login(self):
# Test valid login
result = authenticate_user("user1", "password123")
self.assertTrue(result)

def test_invalid_login(self):
# Test invalid login
result = authenticate_user("user1", "wrongpassword")
self.assertFalse(result)

if __name__ == '__main__':
unittest.main()
27 changes: 27 additions & 0 deletions Tests/unit_tests/test_game_functionality.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import unittest
from game import Game

class TestGameFunctionality(unittest.TestCase):

def setUp(self):
self.game = Game()

def test_initialization(self):
self.assertEqual(self.game.level, 1)
self.assertEqual(self.game.score, 0)
self.assertFalse(self.game.is_game_over)

def test_level_up(self):
self.game.level_up()
self.assertEqual(self.game.level, 2)

def test_score_update(self):
self.game.update_score(100)
self.assertEqual(self.game.score, 100)

def test_game_over(self):
self.game.game_over()
self.assertTrue(self.game.is_game_over)

if __name__ == '__main__':
unittest.main()
Binary file added docs/code_inspection/inspection_report.pdf
Binary file not shown.
18 changes: 18 additions & 0 deletions docs/test_suite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Test Suite

## Unit Tests

- **Test Authentication:**
- `test_authentication.py`: Passed
- `test_game_functionality.py`: Passed

## Integration Tests

- **API Integration:**
- `test_api_integration.py`: Passed
- `test_frontend_integration.py`: Passed

## Security Tests

- **Security Vulnerabilities:**
- `test_security_vulnerabilities.py`: Failed (SQL Injection vulnerability found)
Binary file added docs/usability_report.pdf
Binary file not shown.
132 changes: 29 additions & 103 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<title>GameZone</title>

<!-- Primary Meta Tags -->
<title></title>
<meta name="title" content="GameZone" />
<meta name="description"
content="Welcome to GameZone, the ultimate online gaming destination! Enjoy a vast collection of small games across genres like casual, puzzles, etc. Play directly in your browser. GameZone: endless fun at your fingertips!" />
Expand All @@ -33,104 +32,76 @@
content="Welcome to GameZone, the ultimate online gaming destination! Enjoy a vast collection of small games across genres like casual, puzzles, etc. Play directly in your browser. GameZone: endless fun at your fingertips!" />
<meta property="twitter:image"
content="https://github.com/kunjgit/GameZone/assets/56786344/080b7034-0e60-4069-b95c-aa0aba147a94" />
<!--
- favicon
-->

<!-- favicon -->
<link rel="shortcut icon" href="./assets/images/gamezone.png" type="image/x-icon">

<!--
- custom css link
-->
<!-- custom css link -->
<link rel="stylesheet" href="./assets/css/style.css">
<link rel="stylesheet" href="./assets/css/scroll.css">
<link rel="stylesheet" href="./assets/css/particles.css">
<link rel="stylesheet" href="./assets/css/contributors.css">
<link rel="stylesheet" href="./assets/css/navbar.css">
<link rel="stylesheet" href="./assets/css/gameCard.css">
<link rel="stylesheet" href="./assets/css/navbar.css">
<link rel="stylesheet" href="./assets/css/gameCard.css">
<link rel="stylesheet" href="./assets/css/cursor_transition.css">

<!--
- google font link
-->
<!-- google font link -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap" rel="stylesheet">
<link rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Sofia&effect=neon|outline|emboss|shadow-multiple">
<script src="https://cdn.tailwindcss.com"></script>
<!--
- Audio file for click sound
-->
<!-- Audio file for click sound -->
<audio id="clickSound" src="./assets/audio/click-sound.wav"></audio>
</head>
<!-- Light-Dark theme SWITCH -->


<!-- <p class="invert-color" style="position: sticky; top: 30px; z-index:100; margin-left: 30px;">Theme :</p> -->
<!-- <label class="theme-toggle" for="themeToggle" style="position: fixed; top: 28px; z-index: 100; margin-left: 30px">

<input type="checkbox" id="themeToggle" onclick="toggleTheme()" checked aria-label="Switch theme mode">
<span class="slider"></span>
</label> -->

<body>
<div class="cursor"></div>
<!-- BACKGROUND PARTICLES -->
<!-- <div class="page-bg"></div> -->
<!-- <div class="animation-wrapper"> -->
<!-- <div class="particle particle-1"></div> -->
<!-- <div class="particle particle-2"></div> -->
<!-- <div class="particle particle-3"></div> -->
<!-- <div class="particle particle-4"></div> -->
<!-- </div> -->

<div class="progress-bar">
<div class="filled"></div>
</div>

<div class="abcd">

<main>


<div class="main-content">

<div class="bgContainer"></div>



<!--
- #NAVBAR
-->
<!-- NAVBAR -->
<div class="heading">
<span>πŸ•ΉοΈ&nbsp;</span><span>G</span><span>A</span><span>M</span><span>E</span><span>Z</span><span>O</span><span>N</span><span>E</span>
</div>

<!-- About section -->

<div id="about">

Welcome to our website!! Your ultimate destination for a vast collection of free-to-play games. Dive into a world of
endless entertainment and excitement as you explore our diverse selection of games, ranging from timeless classics to
modern masterpieces. With something for everyone, our website offers an immersive gaming experience that is accessible
to all.

<br><br>

Whether you're a seasoned gamer or just looking for some casual fun, our platform has you covered. Join our community
of gamers and embark on an epic journey through the world of online gaming. Get ready to play, explore, and discover
new adventuresβ€”all for free!

</div>

<br><br><br>
<!-- Contribute section -->
<div id="contribute" style="margin-top: 50px;">
<h2>Contribute to GameZone</h2>
<p>We welcome all contributions from anyone willing to improve or add new scripts to this project. Follow the guidelines below to get started:</p>
<ul>
<li>Fork the repository and clone it locally.</li>
<li>Create a new branch for your contribution.</li>
<li>Make your changes, commit, and push them to your fork.</li>
<li>Submit a pull request with a detailed description of your changes.</li>
</ul>
<p>For more detailed instructions, refer to our <a href="https://github.com/kunjgit/GameZone/blob/main/CONTRIBUTING.md">Contributing Guidelines</a>.</p>
</div>

<br><br><br>

<div class="search-container" id="search-container-id">

<input type="text" class="search-input" placeholder="πŸ•ΉοΈ Search for Games..." id="searchbar">

<input type="text" class="search-input" placeholder="πŸ•ΉοΈ Search for Games..." id="searchbar">
<div class="search-btn">
<i class="fa fa-search" aria-hidden="true"></i>
</div>
Expand All @@ -145,34 +116,25 @@
<br>

<!-- Games -->


<ul class="project-list">
</ul>

<ul class="project-list"></ul>
<div class="pagination">
<button id="prev-page-tile" onclick="goToPreviousPage()">Previous</button>
<div class="pagination_section"></div>
<button id="next-page-tile" onclick="goToNextPage()">Next</button>
</div>


</div>
</div>
<br>
<br>
<br>


<!-- Contributors section -->
<div class="contributors">
<h1 style="font-family: 'Agency FB', Times, serif;">Our Valuable Contributors</h1>
<div id="contributor"></div>
</div>

<!--
FOOTER
-->
<!-- FOOTER -->
<div class="abcd" id="footer">
<div>
<svg class="waves" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
Expand All @@ -189,14 +151,6 @@ <h1 style="font-family: 'Agency FB', Times, serif;">Our Valuable Contributors</h
</svg>
</div>









<footer class="page-footer font-small unique-color-dark pt-4">
<div class="container1">
<div class="list-unstyled list-inline text-center py-2 text-black">
Expand All @@ -208,67 +162,39 @@ <h1 style="font-family: 'Agency FB', Times, serif;">Our Valuable Contributors</h
<br>
<br>
<p style="font-size: 20px; font-style:cursive;cursor: pointer;color: rgb(215, 213, 85);font-family: 'Agency FB', Times, serif;">Make sure you
checkout
my
socials and also
⭐ GameZone on
github</p>

checkout my socials and also ⭐ GameZone on github</p>
</div>
<ul class="socials">

<li><a href="https://github.com/kunjgit" aria-label="Follow me on Github" title="Github (External Link)"
rel="noopener noreferrer" target="_blank"><i class="fa fa-github" aria-hidden="true"></i></a></li>

<li><a href="https://twitter.com/kunj_199" aria-label="Follow me on Twitter" title="Twitter (External Link)"
rel="noopener noreferrer" target="_blank"><svg xmlns="http://www.w3.org/2000/svg" height="1em" aria-hidden="true" focusable="false" class="icon icon-twitter" viewBox="0 0 512 512">
<style>svg{fill:#ffffff}</style><path d="M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z"/></svg></a></li>

rel="noopener noreferrer" target="_blank">
<svg xmlns="http://www.w3.org/2000/svg" height="1em" aria-hidden="true" focusable="false" class="icon icon-twitter" viewBox="0 0 512 512">
<style>svg{fill:#ffffff}</style><path d="M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z"/></svg>
</a></li>
<li><a href="https://www.linkedin.com/in/kunj199/" aria-label="Follow me on Linkedin"
title="Linkedin (External Link)" rel="noopener noreferrer" target="_blank"><i
class="fa fa-linkedin-square" aria-hidden="true"></i></a></li>

</ul>

<!-- Copyright -->

<p id="copyright">&copy; 2024 GameZone. All Rights Reserved.</p>

</div>
</div>
</footer>
</div>



</section>

</article>
</div>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">



</main>




<!--
- custom js link
-->
<!-- custom js link -->
<script src="./assets/js/index.js"></script>
<script src="./assets/js/script.js"></script>
<script src="./assets/js/scroll.js"></script>
<script src="./assets/js/contributors.js"></script>
<script src="./assets/js/cursor_transition.js"></script>



<script type="module" src="https://unpkg.com/[email protected]/dist/ionicons/ionicons.esm.js"></script>
<script nomodule src="https://unpkg.com/[email protected]/dist/ionicons/ionicons.js"></script>
<div>
</div>

<!-- <button onclick="scrollToTop()" id="scrollToTopButton" title="Scroll to Top">
<ion-icon name="arrow-up-outline"></ion-icon>
Expand Down
Loading
Loading