Skip to content

Pengubahan Kecil - UI & Komentar #60

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 3 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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file added __pycache__/app.cpython-312.pyc
Binary file not shown.
64 changes: 54 additions & 10 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,58 @@
import os
from flask import Flask
from flask import Flask, render_template, request, redirect, url_for, session

app = Flask(__name__)
app.secret_key = 'rahasia123' # Untuk session

# Dummy login
USER_CREDENTIALS = {
'admin': 'admin'
}

# Halaman utama / login
@app.route('/', methods=['GET', 'POST'])
def login():
if request.method == 'POST':
username = request.form['username']
password = request.form['password']
if username in USER_CREDENTIALS and USER_CREDENTIALS[username] == password:
session['username'] = username
return redirect(url_for('dashboard'))
else:
return render_template('login.html', error="Username atau password salah.")
return render_template('login.html')

# Dashboard setelah login
@app.route('/dashboard')
def dashboard():
if 'username' in session:
return render_template('dashboard.html')
return redirect(url_for('login'))

# Halaman create item
@app.route('/create', methods=['GET', 'POST'])
def create():
if 'username' not in session:
return redirect(url_for('login'))
if request.method == 'POST':
item_name = request.form['item_name']
# Di sini bisa ditambahkan logika menyimpan item ke database
print(f"Item ditambahkan: {item_name}") # Debug ke terminal
return redirect(url_for('success'))
return render_template('create.html')

@app.route("/")
def main():
return "Welcome!"
# Halaman sukses setelah create
@app.route('/success')
def success():
if 'username' not in session:
return redirect(url_for('login'))
return render_template('success.html')

@app.route('/how are you')
def hello():
return 'I am good, how about you?'
# Logout
@app.route('/logout')
def logout():
session.clear()
return redirect(url_for('login'))

if __name__ == "__main__":
app.run(host="0.0.0.0", port=8080)
# Menjalankan app
if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0')
35 changes: 35 additions & 0 deletions docs/uml/class-diagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@startuml

class User {
+id: int
+username: str
+email: str
+password: str
}

class RegisterForm {
+username: str
+email: str
+password: str
+submit(): void
}

class LoginForm {
+username: str
+password: str
+submit(): void
}

class Item {
+id: int
+name: str
+description: str
+price: float
+create(): void
}

User "1" --> "*" Item : owns
RegisterForm ..> User : <<uses>>
LoginForm ..> User : <<uses>>

@enduml
13 changes: 13 additions & 0 deletions docs/uml/sequence-create-item.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@startuml sequence-create-item
actor User
participant "Create Item Page" as ItemPage
participant "routes.py" as Route
participant "models.py" as ItemModel

User -> ItemPage : open form
User -> ItemPage : input item data
ItemPage -> Route : POST /create
Route -> ItemModel : save new item
ItemModel --> Route : success
Route --> ItemPage : show confirmation
@enduml
17 changes: 17 additions & 0 deletions docs/uml/sequence-login.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@startuml sequence-login
actor User
participant "Login Page" as LoginPage
participant "routes.py" as Route
participant "models.py" as UserModel

User -> LoginPage : open form
User -> LoginPage : input username & password
LoginPage -> Route : POST /login
Route -> UserModel : validate_user()
UserModel --> Route : user exists or not
alt valid
Route --> LoginPage : redirect to dashboard
else invalid
Route --> LoginPage : show error
end
@enduml
18 changes: 18 additions & 0 deletions evaluasi/blackbox/hasil-blackbox.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Hasil Black-Box Testing – UAS RPL

### ✅ Test 1 – Login
- Input: admin / admin
- Expected: Masuk dashboard
- Result: ✅ Pass

### ✅ Test 2 – Tambah Item
- Input: "Item Baru"
- Expected: Redirect ke halaman sukses
- Result: ✅ Pass

### ✅ Test 3 – Logout
- Action: Klik tombol logout
- Expected: Redirect ke login
- Result: ✅ Pass

### File Selenium IDE: `uas-blackbox.side`
20 changes: 20 additions & 0 deletions evaluasi/blackbox/sus/laporan-sus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Laporan Usability Study – Aplikasi UAS RPL

### Link Aplikasi:
https://fictional-system-xxxxx.github.dev

### Jumlah Responden:
5 orang

### Skor SUS:
- R1: 85
- R2: 80
- R3: 72.5
- R4: 87.5
- R5: 77.5

### Rata-rata:
**80.5**

### Interpretasi:
Rata-rata skor SUS menunjukkan kategori **Good**. Aplikasi dinilai cukup mudah digunakan dan dapat diakses tanpa kesulitan berarti oleh pengguna.
Binary file added evaluasi/blackbox/sus/sus_score_chart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
196 changes: 196 additions & 0 deletions evaluasi/blackbox/uas-blackbox.side
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
{
"id": "2c332850-1619-4fcb-b28e-298b6d9f6ed2",
"version": "2.0",
"name": "uas-rpl-test",
"url": "https://fictional-system-7vr75gwr75r72xr6w-5000.app.github.dev",
"tests": [{
"id": "28bfa88b-cc53-4ab2-a427-01063482dfbe",
"name": "uas-blackbox.side",
"commands": [{
"id": "3b4b3666-8522-4e49-aebb-2808a291459d",
"comment": "",
"command": "open",
"target": "/",
"targets": [],
"value": ""
}, {
"id": "053b110c-81a4-4b45-ad2b-24c79ac36c5c",
"comment": "",
"command": "setWindowSize",
"target": "1366x728",
"targets": [],
"value": ""
}, {
"id": "62ba2501-9c76-4b9c-aed7-64b081723e36",
"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": "fc5e904b-679b-4ae4-b2dc-e4427416aa8e",
"comment": "",
"command": "click",
"target": "name=username",
"targets": [
["name=username", "name"],
["css=input:nth-child(1)", "css:finder"],
["xpath=//input[@name='username']", "xpath:attributes"],
["xpath=//input", "xpath:position"]
],
"value": ""
}, {
"id": "1f41577d-2584-4b78-b442-b62eb0701c59",
"comment": "",
"command": "type",
"target": "name=username",
"targets": [
["name=username", "name"],
["css=input:nth-child(1)", "css:finder"],
["xpath=//input[@name='username']", "xpath:attributes"],
["xpath=//input", "xpath:position"]
],
"value": "admin"
}, {
"id": "749d724d-b5d3-4e5e-80b5-976e87eb0be3",
"comment": "",
"command": "click",
"target": "css=html",
"targets": [
["css=html", "css:finder"],
["xpath=//html", "xpath:position"]
],
"value": ""
}, {
"id": "ba45c61f-2ca9-49bd-8ffd-920f6dbe1605",
"comment": "",
"command": "click",
"target": "name=username",
"targets": [
["name=username", "name"],
["css=input:nth-child(1)", "css:finder"],
["xpath=//input[@name='username']", "xpath:attributes"],
["xpath=//input", "xpath:position"]
],
"value": ""
}, {
"id": "c28c12ec-3ddf-4a01-b2b5-257dec9dc67f",
"comment": "",
"command": "click",
"target": "name=password",
"targets": [
["name=password", "name"],
["css=input:nth-child(3)", "css:finder"],
["xpath=//input[@name='password']", "xpath:attributes"],
["xpath=//input[2]", "xpath:position"]
],
"value": ""
}, {
"id": "70016744-16fb-4781-a45e-a4b9368a38a5",
"comment": "",
"command": "type",
"target": "name=password",
"targets": [
["name=password", "name"],
["css=input:nth-child(3)", "css:finder"],
["xpath=//input[@name='password']", "xpath:attributes"],
["xpath=//input[2]", "xpath:position"]
],
"value": "admin"
}, {
"id": "1d92909f-78e0-42cd-873c-706e3e7b4f31",
"comment": "",
"command": "click",
"target": "css=input:nth-child(5)",
"targets": [
["css=input:nth-child(5)", "css:finder"],
["xpath=//input[@value='Login']", "xpath:attributes"],
["xpath=//input[3]", "xpath:position"]
],
"value": ""
}, {
"id": "ea852a1c-3210-49bb-887e-b0b9339c9a20",
"comment": "",
"command": "click",
"target": "css=a:nth-child(3) > button",
"targets": [
["css=a:nth-child(3) > button", "css:finder"],
["xpath=//button", "xpath:position"],
["xpath=//button[contains(.,'Tambah Item')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "43614014-15cd-46ca-bb62-28348221dd59",
"comment": "",
"command": "click",
"target": "name=item_name",
"targets": [
["name=item_name", "name"],
["css=input:nth-child(1)", "css:finder"],
["xpath=//input[@name='item_name']", "xpath:attributes"],
["xpath=//input", "xpath:position"]
],
"value": ""
}, {
"id": "6545db80-e2f8-4f77-8477-d8902270f3df",
"comment": "",
"command": "type",
"target": "name=item_name",
"targets": [
["name=item_name", "name"],
["css=input:nth-child(1)", "css:finder"],
["xpath=//input[@name='item_name']", "xpath:attributes"],
["xpath=//input", "xpath:position"]
],
"value": "buaya1"
}, {
"id": "5cbecf03-669c-4fbf-bd0b-2f1e14378151",
"comment": "",
"command": "click",
"target": "css=input:nth-child(2)",
"targets": [
["css=input:nth-child(2)", "css:finder"],
["xpath=//input[@value='Simpan']", "xpath:attributes"],
["xpath=//input[2]", "xpath:position"]
],
"value": ""
}, {
"id": "c4fbbdbf-c06a-47ca-b16e-12fd2e3ff935",
"comment": "",
"command": "click",
"target": "css=button",
"targets": [
["css=button", "css:finder"],
["xpath=//button", "xpath:position"],
["xpath=//button[contains(.,'Kembali ke Dashboard')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "62dbfd5c-9508-49c4-a368-76dc86db9365",
"comment": "",
"command": "click",
"target": "css=a:nth-child(4) > button",
"targets": [
["css=a:nth-child(4) > button", "css:finder"],
["xpath=//a[2]/button", "xpath:position"],
["xpath=//button[contains(.,'Logout')]", "xpath:innerText"]
],
"value": ""
}]
}],
"suites": [{
"id": "440e355b-71fa-47ca-bb52-e2a611fcaa10",
"name": "Default Suite",
"persistSession": false,
"parallel": false,
"timeout": 300,
"tests": ["28bfa88b-cc53-4ab2-a427-01063482dfbe"]
}],
"urls": ["https://fictional-system-7vr75gwr75r72xr6w-5000.app.github.dev/"],
"plugins": []
}
22 changes: 22 additions & 0 deletions h origin uas-rpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
3251741 (HEAD -> uas-rpl, master) Perubahan kecil: ubah label tombol dan komentar fungsi logout
9dd6dff (origin/master, origin/HEAD) Merge pull request #15 from Tej-Singh-Rana/master
a23e2f6 Removed the extra spaces
47fd1dc Update ubuntu version
4efe4c7 Updated Dockerfile
3f3bd2d Updated python version
5ce20c9 Upgraded ubuntu version to 18.04
e2e6359 Merge pull request #6 from suyogpatil/patch-3
ae46f74 Update
efc0b6b Merge pull request #4 from suyogpatil/patch-1
b31344f Update Dockerfile
f592b20 Update Dockerfile
3e0c7fc Rename dockerfile to Dockerfile
e2e91fb Merge pull request #2 from tanbir2684/patch-1
08f3037 Create dockerfile
b441bb9 Update app.py
e8704ae Update app.py
868da47 Create requirements.txt
1e3d0b7 Update README.md
5374b64 Create app.py
47dacf4 Create README.md
430d0e7 Initial commit
Loading