-
Notifications
You must be signed in to change notification settings - Fork 574
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
135 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# pylint: disable=import-error, no-name-in-module, too-few-public-methods, too-many-ancestors | ||
|
||
''' | ||
Chats are managed in this screen | ||
''' | ||
|
||
from kivy.uix.screenmanager import Screen | ||
|
||
|
||
class Chat(Screen): | ||
"""Chat Screen class for kivy Ui""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
#:import C kivy.utils.get_color_from_hex | ||
#:import MDTextField kivymd.uix.textfield.MDTextField | ||
<Chat>: | ||
name: 'chat' | ||
BoxLayout: | ||
orientation: 'vertical' | ||
canvas.before: | ||
Color: | ||
rgba: 1,1,1,1 | ||
Rectangle: | ||
pos: self.pos | ||
size: self.size | ||
ScrollView: | ||
Label: | ||
id: chat_logs | ||
text: '' | ||
color: C('#101010') | ||
text_size: (self.width, None) | ||
halign: 'left' | ||
valign: 'top' | ||
padding: (0, 0) # fixed in Kivy 1.8.1 | ||
size_hint: (1, None) | ||
height: self.texture_size[1] | ||
markup: True | ||
font_size: sp(20) | ||
MDBoxLayout: | ||
size_hint_y: None | ||
spacing:5 | ||
orientation: 'horizontal' | ||
pos_hint: {'center_y': 1, 'center_x': 1} | ||
halign: 'right' | ||
pos_hint: {'left': 0} | ||
pos_hint: {'x':.8} | ||
height: dp(50) + self.minimum_height | ||
MDFillRoundFlatButton: | ||
text: app.tr._("First message") | ||
opposite_colors: True | ||
pos_hint: {'center_x':0.8,'center_y':0.7} | ||
|
||
|
||
|
||
BoxLayout: | ||
height: 50 | ||
orientation: 'horizontal' | ||
padding: 0 | ||
size_hint: (1, None) | ||
|
||
MDTextField: | ||
id:'id_message_body' | ||
hint_text: 'Empty field' | ||
icon_left: "message" | ||
hint_text: "please enter your text" | ||
mode: "fill" | ||
fill_color: 1/255, 144/255, 254/255, 0.1 | ||
multiline: True | ||
font_color_normal: 0, 0, 0, .4 | ||
icon_right: 'grease-pencil' | ||
icon_right_color: app.theme_cls.primary_light | ||
pos_hint: {'center_x':0.2,'center_y':0.7} | ||
|
||
MDIconButton: | ||
id: file_manager | ||
icon: "attachment" | ||
opposite_colors: True | ||
on_release: app.file_manager_open() | ||
theme_text_color: "Custom" | ||
text_color: app.theme_cls.primary_color | ||
|
||
MDIconButton: | ||
icon: 'camera' | ||
opposite_colors: True | ||
theme_text_color: "Custom" | ||
text_color: app.theme_cls.primary_color | ||
MDIconButton: | ||
id: send_message | ||
icon: "send" | ||
# x: root.parent.x + dp(10) | ||
# pos_hint: {"top": 1, 'left': 1} | ||
color: [1,0,0,1] | ||
on_release: app.rest_default_avatar_img() | ||
theme_text_color: "Custom" | ||
text_color: app.theme_cls.primary_color |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from .telenium_process import TeleniumTestProcess | ||
from .common import ordered | ||
|
||
|
||
class ChatScreen(TeleniumTestProcess): | ||
"""Chat Screen Functionality Testing""" | ||
|
||
@ordered | ||
def test_open_chat_screen(self): | ||
"""Opening Chat screen""" | ||
# Checking current Screen(Inbox screen) | ||
self.assert_wait_no_except('//ScreenManager[@current]', timeout=15, value='inbox') | ||
# Method to open side navbar | ||
self.open_side_navbar() | ||
# this is for scrolling Nav drawer | ||
self.drag("//NavigationItem[@text=\"Sent\"]", "//NavigationItem[@text=\"Inbox\"]") | ||
# assert for checking scroll function | ||
self.assertCheckScrollDown('//ContentNavigationDrawer//ScrollView[0]', timeout=10) | ||
# Checking Chat screen label on side nav bar | ||
self.assertExists('//NavigationItem[@text=\"Chat\"]', timeout=5) | ||
# this is for opening Chat screen | ||
self.cli.wait_click('//NavigationItem[@text=\"Chat\"]', timeout=5) | ||
# Checking navigation bar state | ||
self.assertExists('//MDNavigationDrawer[@status~=\"closed\"]', timeout=5) | ||
# Checking current screen | ||
self.assertExists("//Chat[@name~=\"chat\"]", timeout=5) |