Fakultas Ilmu Komputer UI

Commit e0682f72 authored by Michael Christopher Manullang's avatar Michael Christopher Manullang
Browse files

Implemented Name Banner

parent 9c28c3c1
Pipeline #57934 failed
......@@ -18,6 +18,42 @@ pylint:
paths:
- ./pylint/
functional-test:
image: ubuntu:latest
stage: fntest
services:
- postgres:alpine
variables:
POSTGRES_DB: gitlab_test
POSTGRES_USER: gitlab_test
POSTGRES_PASSWORD: SebuahPassword
POSTGRES_HOST_AUTH_METHOD: trust
before_script:
- apt-get update -qq
- apt-get install -qq software-properties-common
- apt-add-repository universe
- add-apt-repository ppa:deadsnakes/ppa
- apt update
- apt-get install -qq python3.7
- apt-get install -qq python3-pip
- pip3 install virtualenv
- virtualenv env
- source env/bin/activate
- export DATABASE_URL=postgres://$POSTGRES_USER:$POSTGRES_PASSWORD@postgres:5432/$POSTGRES_DB
- pip3 install -r requirements.txt
- python3 manage.py makemigrations
- python3 manage.py migrate
- python3 manage.py collectstatic --no-input
- apt-get install -qq firefox
- apt install -qq curl -y
- curl -L -O https://github.com/mozilla/geckodriver/releases/download/v0.27.0/geckodriver-v0.27.0-linux64.tar.gz
- tar -xf geckodriver-v0.27.0-linux64.tar.gz -C /usr/local/bin
- chmod +x /usr/local/bin/geckodriver
when: on_success
script:
- python manage.py runserver && python3 functional_tests.py
allow_failure: true
UnitTest:
services:
- postgres:alpine
......
......@@ -4,7 +4,7 @@
* Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap-heroic-features/blob/master/LICENSE)
*/
body {
padding-top: 56px;
/*padding-top: 56px;*/
}
.center {
text-align: center;
......
.katalog-brand {
background-color: #615CFD
}
\ No newline at end of file
<nav class="navbar navbar-dark static-top shadow katalog-navbar"> <!-- Sidebar Toggle (Topbar) -->
<div class="sidebar-brand-text">Digipus</div>
</nav>
\ No newline at end of file
......@@ -39,14 +39,19 @@
<link rel="stylesheet" type="text/css" href="{% static 'css/styles.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'css/util.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'css/main.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'css/navbar_katalog_materi.css' %}">
<!--===============================================================================================-->
{% endblock header %}
{% block content %}
</head>
<body style="background-color: #f8f8f8;">
{% include 'app/includes/navbar_katalog_materi.html' %}
<!-- Page Content -->
<div class="container">
......
......@@ -928,4 +928,18 @@ class RevisiMateriTest(TestCase):
response = self.client.get(self.url)
self.assertEqual(response.status_code, 200)
# Logout
self.client.logout()
\ No newline at end of file
self.client.logout()
#from selenium import webdriver
#class NameBannerFunctionalTest(TestCase):
# browser = webdriver.Firefox()
# #I visit the homepage
# browser.get('http://localhost:8000')
# #I see a namebanner
# assert 'navbar' in browser
# #The namebanner has digipus on it
# assert 'Digipus' in browser.body.navbar
# browser.quit()
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
import unittest
from selenium.common.exceptions import NoSuchElementException
class NavbarKatalogFunctionalTests(unittest.TestCase):
def setUp(self):
self.browser = webdriver.Firefox()
def tearDown(self):
self.browser.quit()
def test_title_is_michael_christopher_manullang(self):
#Ketika Pengguna mengakses web page, ia akan menemukan navbar yang berisikan digipus.
self.browser.get('http://127.0.0.1:8000')
try:
self.assertIn('Digipus', self.browser.find_element_by_css_selector('nav.katalog-navbar').text)
except NoSuchElementException:
self.fail('No such element: Katalog Brand')
if __name__ == '__main__':
unittest.main()
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment