Skip to content

feat: tambah route /about #56

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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"githubPullRequests.ignoredPullRequestBranches": [
"master"
]
}
54 changes: 48 additions & 6 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,56 @@
import os
from flask import Flask
app = Flask(__name__)

@app.route("/")
def main():
return "Welcome!"
def home():
return """
<html>
<head>
<title>Selamat Datang!</title>
<style>
body { font-family: Arial, sans-serif; text-align: center; margin-top: 100px; background-color: #f0f8ff; }
h1 { color: #333; }
p { font-size: 18px; }
a.button {
display: inline-block;
padding: 10px 20px;
margin-top: 20px;
font-size: 16px;
color: white;
background-color: #007BFF;
border: none;
border-radius: 5px;
text-decoration: none;
}
a.button:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<h1>🚀 Selamat datang di aplikasi web Flask!</h1>
<p>Hai, saya <strong>Iqbal Yusanta</strong> (A710230023), ini adalah proyek praktikum saya menggunakan Python Flask.</p>
<p>Silakan coba tombol di bawah ini untuk melihat halaman lain:</p>
<a href="/about" class="button">Ke Halaman About</a>
</body>
</html>
"""

@app.route('/how are you')
def hello():
return 'I am good, how about you?'
@app.route("/about")
def about():
return """
<html>
<head><title>About</title></head>
<body style="font-family: Arial; text-align: center; margin-top: 100px;">
<h2>📄 Halaman Tentang</h2>
<p>Aplikasi ini dibuat oleh Iqbal Yusanta untuk latihan menggunakan Flask.</p>
<a href="/" style="text-decoration: none; color: #007BFF;">⬅️ Kembali ke Beranda</a>
</body>
</html>
"""

if __name__ == "__main__":
app.run(host="0.0.0.0", port=8080)



Binary file added docs/uml/classes_flask_app_nama.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/uml/erd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions docs/uml/schema.dbml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Table users {
id int [pk]
username varchar
password varchar
}

Table items {
id int [pk]
name varchar
description text
user_id int [ref: > users.id]
}
Binary file added docs/uml/sequence_create_item.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions docs/uml/sequence_create_item.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@startuml
actor User
participant "Create Page" as CP
participant "Item Controller" as IC
participant "Database" as DB

User -> CP: Fill item form
CP -> IC: Submit create_item()
IC -> DB: Save to database
DB --> IC: Success
IC --> CP: Show confirmation
@enduml
Binary file added docs/uml/sequence_login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions docs/uml/sequence_login.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@startuml
actor User
participant "Login Page" as LP
participant "Auth Controller" as AC
participant "Database" as DB

User -> LP: Input username & password
LP -> AC: Submit login()
AC -> DB: Check credentials
DB --> AC: Valid / Invalid
AC --> LP: Redirect or show error
@enduml
29 changes: 29 additions & 0 deletions evaluasi/blackbox/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Laporan Black-Box Testing

## 1. Tujuan
Melakukan pengujian black-box pada aplikasi Flask sederhana dengan skenario login, menambahkan data, dan logout menggunakan Selenium IDE.

## 2. Skenario Pengujian
- Buka halaman utama
- Klik tombol login
- Masukkan username dan password
- Klik tombol "Tambah Data"
- Logout

## 3. Alat yang Digunakan
- **Selenium IDE**
- **Browser** (Chrome / Firefox)
- **GitHub Codespaces (untuk hosting app)**

## 4. Hasil Uji
File pengujian disimpan dalam file `test.side`.

### Bukti Screenshot:
(Sisipkan file screenshot jika ada, atau catat pass/fail)

- ✅ Login berhasil
- ✅ Tambah data berhasil
- ✅ Logout berhasil

## 5. Kesimpulan
Semua fitur utama yang diuji berjalan dengan baik. Tidak ditemukan bug pada skenario yang diuji.
174 changes: 174 additions & 0 deletions evaluasi/blackbox/silenium test.side
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
{
"id": "4b8019c9-4ecf-4fe8-bfe6-39cfd438e0ff",
"version": "2.0",
"name": "flask-test",
"url": "https://opulent-space-palm-tree-wr4459g9qj7v3gp94-8080.app.github.dev",
"tests": [{
"id": "eec55dc4-17a1-4126-b128-7d6f0ff004f2",
"name": "Untitled",
"commands": [{
"id": "c253cbe7-e633-4172-8935-1a5f34553b77",
"comment": "",ls evaluasi/blackbox/
"command": "open",
"target": "/",
"targets": [],
"value": ""
}, {
"id": "fe2a07ae-075c-4113-bf6a-608b3ae22a21",
"comment": "",
"command": "setWindowSize",
"target": "1295x735",
"targets": [],
"value": ""
}, {
"id": "6eff7681-4b2f-43d1-90bb-52d0578dcad6",
"comment": "",
"command": "click",
"target": "css=.btn-primary",
"targets": [
["css=.btn-primary", "css:finder"],
["xpath=//button[@type='submit']", "xpath:attributes"],
["xpath=//button", "xpath:position"],
["xpath=//button[contains(.,'Continue')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "61b7cc8f-a512-4e84-bc80-6ab7d0e94979",
"comment": "",
"command": "click",
"target": "css=html",
"targets": [
["css=html", "css:finder"],
["xpath=//html", "xpath:position"],
["xpath=//html[contains(.,'selamat datang di akun milik iqbal yusanta a710230023')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "3a493674-bf9e-42f2-a6e0-e30ee6e4fcd8",
"comment": "",
"command": "close",
"target": "",
"targets": [],
"value": ""
}, {
"id": "14de127d-c9d8-4f8c-944f-4dd4d6cef3f0",
"comment": "",
"command": "close",
"target": "",
"targets": [],
"value": ""
}, {
"id": "43bc8836-5eea-45fa-a879-08b4d23b7a8f",
"comment": "",
"command": "click",
"target": "css=html",
"targets": [
["css=html", "css:finder"],
["xpath=//html", "xpath:position"]
],
"value": ""
}, {
"id": "90789e9f-28d4-4906-97ef-a3b5304cbee3",
"comment": "",
"command": "click",
"target": "linkText=Ke Halaman About",
"targets": [
["linkText=Ke Halaman About", "linkText"],
["css=.button", "css:finder"],
["xpath=//a[contains(text(),'Ke Halaman About')]", "xpath:link"],
["xpath=//a[contains(@href, '/about')]", "xpath:href"],
["xpath=//a", "xpath:position"],
["xpath=//a[contains(.,'Ke Halaman About')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "1bdc3c01-9c90-4f02-bdaf-b0d0a7d690a4",
"comment": "",
"command": "click",
"target": "css=body",
"targets": [
["css=body", "css:finder"],
["xpath=//body", "xpath:position"]
],
"value": ""
}, {
"id": "fa942c46-85c2-4af0-bd8b-4c13c06311fd",
"comment": "",
"command": "click",
"target": "css=body",
"targets": [
["css=body", "css:finder"],
["xpath=//body", "xpath:position"]
],
"value": ""
}, {
"id": "39817591-958f-4a9d-aa01-b15201630417",
"comment": "",
"command": "click",
"target": "linkText=Ke Halaman About",
"targets": [
["linkText=Ke Halaman About", "linkText"],
["css=.button", "css:finder"],
["xpath=//a[contains(text(),'Ke Halaman About')]", "xpath:link"],
["xpath=//a[contains(@href, '/about')]", "xpath:href"],
["xpath=//a", "xpath:position"],
["xpath=//a[contains(.,'Ke Halaman About')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "845ae73f-f855-473a-8b26-40a5460dd195",
"comment": "",
"command": "click",
"target": "css=body",
"targets": [
["css=body", "css:finder"],
["xpath=//body", "xpath:position"]
],
"value": ""
}, {
"id": "fb81d979-5283-4104-9363-fc592791291f",
"comment": "",
"command": "click",
"target": "css=html",
"targets": [
["css=html", "css:finder"],
["xpath=//html", "xpath:position"]
],
"value": ""
}, {
"id": "93de2420-fd65-415d-8eba-3bb56227d45a",
"comment": "",
"command": "click",
"target": "css=html",
"targets": [
["css=html", "css:finder"],
["xpath=//html", "xpath:position"]
],
"value": ""
}, {
"id": "144a06b2-96d7-44db-9eef-959b3b052012",
"comment": "",
"command": "click",
"target": "linkText=⬅️ Kembali ke Beranda",
"targets": [
["linkText=⬅️ Kembali ke Beranda", "linkText"],
["css=a", "css:finder"],
["xpath=//a[contains(text(),'⬅️ Kembali ke Beranda')]", "xpath:link"],
["xpath=//a[contains(@href, '/')]", "xpath:href"],
["xpath=//a", "xpath:position"],
["xpath=//a[contains(.,'⬅️ Kembali ke Beranda')]", "xpath:innerText"]
],
"value": ""
}]
}],
"suites": [{
"id": "b95dbb8f-d4eb-44d3-95f5-3928c7fb231a",
"name": "Default Suite",
"persistSession": false,
"parallel": false,
"timeout": 300,
"tests": ["eec55dc4-17a1-4126-b128-7d6f0ff004f2"]
}],
"urls": ["https://opulent-space-palm-tree-wr4459g9qj7v3gp94-8080.app.github.dev/"],
"plugins": []
}
Loading