Skip to content

Commit

Permalink
Merge pull request #126 from Altran-PT-GDC/release_4.1
Browse files Browse the repository at this point in the history
Release 4.1
  • Loading branch information
samuelpcabral committed Dec 28, 2023
2 parents da4653b + 7555a01 commit 98d6f22
Show file tree
Hide file tree
Showing 17 changed files with 77 additions and 90 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ env
# Coverage reports
.coverage
htmlcov

# Personal test cases
atest/test_with_login.robot
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Version: 4.1

* [#113](https://github.com/Altran-PT-GDC/Robot-Framework-Mainframe-3270-Library/pull/113): #110 Get Cursor Position
* [#114](https://github.com/Altran-PT-GDC/Robot-Framework-Mainframe-3270-Library/pull/114): #112 Implement find string keyword
* [#115](https://github.com/Altran-PT-GDC/Robot-Framework-Mainframe-3270-Library/pull/115): #111 Read From Current Position keyword
* [#118](https://github.com/Altran-PT-GDC/Robot-Framework-Mainframe-3270-Library/pull/118): #117 Create Get String Positions Only Before / After keywords
* [#124](https://github.com/Altran-PT-GDC/Robot-Framework-Mainframe-3270-Library/pull/124): Release version 4.1


# Version: 4.1

* [#113](https://github.com/Altran-PT-GDC/Robot-Framework-Mainframe-3270-Library/pull/113): #110 Get Cursor Position
* [#114](https://github.com/Altran-PT-GDC/Robot-Framework-Mainframe-3270-Library/pull/114): #112 Implement find string keyword
* [#115](https://github.com/Altran-PT-GDC/Robot-Framework-Mainframe-3270-Library/pull/115): #111 Read From Current Position keyword
Expand Down
4 changes: 1 addition & 3 deletions Mainframe3270/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import os
from datetime import timedelta
from typing import Any

from robot.api import logger
from robot.api.deco import keyword
from robot.libraries.BuiltIn import BuiltIn, RobotNotRunningError
from robot.utils import ConnectionCache
from robotlibcore import DynamicCore

from Mainframe3270.keywords import (
AssertionKeywords,
CommandKeywords,
Expand Down Expand Up @@ -129,7 +127,7 @@ def __init__(
model: str = "2",
) -> None:
"""
By default the emulator visibility is set to visible=True.
By default, the emulator visibility is set to visible=True.
In this case test cases are executed using wc3270 (Windows) or x3270 (Linux/MacOSX).
You can change this by setting visible=False.
Then test cases are run using ws3720 (Windows) or s3270 (Linux/MacOS).
Expand Down
2 changes: 0 additions & 2 deletions Mainframe3270/keywords/assertions.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import re
from typing import List, Optional

from robot.api import logger
from robot.api.deco import keyword
from robot.utils import Matcher

from Mainframe3270.librarycomponent import LibraryComponent


Expand Down
6 changes: 3 additions & 3 deletions Mainframe3270/keywords/commands.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import time
from typing import Optional, Union

from robot.api.deco import keyword

from Mainframe3270.librarycomponent import LibraryComponent
from Mainframe3270.utils import ResultMode, prepare_position_as


class CommandKeywords(LibraryComponent):
@keyword("Execute Command")
def execute_command(self, cmd: str) -> None:
"""Execute a [http://x3270.bgp.nu/wc3270-man.html#Actions|x3270 command].
"""Execute a [https://x3270.miraheze.org/wiki/Category:Wc3270_actions|x3270 command].
Example:
| Execute Command | Enter |
| Execute Command | Home |
| Execute Command | Tab |
| Execute Command | PF(1) |
| Execute Command | Scroll(backward) | # To send Page Up |
| Execute Command | Scroll(forward) | # To send Page Down |
"""
self.mf.exec_command(cmd.encode("utf-8"))
time.sleep(self.wait_time)
Expand Down
2 changes: 0 additions & 2 deletions Mainframe3270/keywords/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
import shlex
from os import name as os_name
from typing import List, Optional, Union

from robot.api import logger
from robot.api.deco import keyword

from Mainframe3270.librarycomponent import LibraryComponent
from Mainframe3270.py3270 import Emulator

Expand Down
2 changes: 0 additions & 2 deletions Mainframe3270/keywords/read_write.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import time
from typing import Any, Optional

from robot.api.deco import keyword

from Mainframe3270.librarycomponent import LibraryComponent
from Mainframe3270.utils import ResultMode, prepare_positions_as

Expand Down
2 changes: 0 additions & 2 deletions Mainframe3270/keywords/screenshot.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import os
import time

from robot.api import logger
from robot.api.deco import keyword

from Mainframe3270.librarycomponent import LibraryComponent


Expand Down
2 changes: 0 additions & 2 deletions Mainframe3270/keywords/wait_and_timeout.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import time
from datetime import timedelta

from robot.api.deco import keyword
from robot.utils import secs_to_timestr

from Mainframe3270.librarycomponent import LibraryComponent
from Mainframe3270.utils import convert_timeout

Expand Down
1 change: 0 additions & 1 deletion Mainframe3270/librarycomponent.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from robot.utils import ConnectionCache

from Mainframe3270.py3270 import Emulator


Expand Down
1 change: 0 additions & 1 deletion Mainframe3270/py3270.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from abc import ABC, abstractmethod
from contextlib import closing
from os import name as os_name

from robot.utils import seq2str

log = logging.getLogger(__name__)
Expand Down
1 change: 0 additions & 1 deletion Mainframe3270/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from datetime import timedelta
from enum import Enum, auto
from typing import List, Tuple

from robot.api import logger
from robot.utils import timestr_to_secs

Expand Down
1 change: 0 additions & 1 deletion atest/connection.robot
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ Resource pub400_variables.robot
Library OperatingSystem
Library ../Mainframe3270/ ${VISIBLE}
Library HelperLibrary.py

Test Teardown Test Teardown


Expand Down
23 changes: 6 additions & 17 deletions atest/mainframe.robot
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
*** Settings ***
Documentation These tests verify that all keywords are working correctly and displaying the expected exception messages.
Library OperatingSystem
Library String
Library ../Mainframe3270/ run_on_failure_keyword=None
Library HelperLibrary.py
Resource pub400_variables.robot

Suite Setup Suite Setup
Suite Teardown Suite Teardown
Suite Setup Suite Mainframe Setup
Suite Teardown Suite Mainframe Teardown


*** Test Cases ***
Expand Down Expand Up @@ -323,15 +321,15 @@ Test Get String Positions Only Before Without Results


*** Keywords ***
Suite Setup
Suite Mainframe Setup
Open Connection ${HOST}
Create Directory ${FOLDER}
Empty Directory ${FOLDER}
Set Screenshot Folder ${FOLDER}
Change Wait Time 0.4
Change Wait Time After Write 0.4

Suite Teardown
Suite Mainframe Teardown
Run Keyword And Ignore Error Close Connection

Verify String Not Found
Expand Down Expand Up @@ -364,19 +362,10 @@ Verify Pattern Not Found
END

Verify String Does Not Appear X Times
[Arguments]
... ${keyword}
... ${string}
... ${wrong_number_of_times}
... ${right_number_of_times}
... ${ignore_case}=${False}
[Arguments] ${keyword} ${string} ${wrong_number_of_times} ${right_number_of_times} ${ignore_case}=${False}
${expected_error} Set Variable
... The string "${string}" was not found "${wrong_number_of_times}" times, it appears "${right_number_of_times}" times
Run Keyword And Expect Error
... ${expected_error}
... ${keyword}
... ${string}
... ${wrong_number_of_times}
Run Keyword And Expect Error ${expected_error} ${keyword} ${string} ${wrong_number_of_times}
... ignore_case=${ignore_case}

Verify String Found
Expand Down
Binary file modified dist/robotframework-mainframe3270-4.1.tar.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions doc/Mainframe3270.html

Large diffs are not rendered by default.

Loading

0 comments on commit 98d6f22

Please sign in to comment.