-
Notifications
You must be signed in to change notification settings - Fork 3
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
Domain eap operations #138
Open
prachiyadav
wants to merge
5
commits into
master
Choose a base branch
from
domain-eap-operations
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
83ebe50
EAP Power Operation related Test case Added
d491ae6
edited test case for domain server group
d436d87
edited Test and added kill EAP Test
06ccaec
reactored and changed function name as per sugestion
893eb78
added Test cases and refactored as per sugestion
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,54 @@ | ||
import pytest | ||
from common.session import session | ||
from views.domain_mode_eap_operations import domain_mode_eap_operations | ||
|
||
@pytest.fixture (scope='session') | ||
def web_session(request): | ||
web_session = session(add_provider=True) | ||
web_session.logger.info("OPR010, OPR011, OPR012, OPR013, OPR014, OPR015: Operations on Single JBoss EAP in a server group") | ||
|
||
def closeSession(): | ||
web_session.logger.info("Close browser session") | ||
web_session.close_web_driver() | ||
|
||
request.addfinalizer(closeSession) | ||
|
||
return web_session | ||
|
||
|
||
def test_domain_mode_eap_stop(web_session): | ||
web_session.logger.info("Begin eap Stop Test") | ||
assert domain_mode_eap_operations(web_session).stop_eap() | ||
|
||
def test_eap_start(web_session): | ||
web_session.logger.info("Begin eap Start Test") | ||
assert domain_mode_eap_operations(web_session).start_eap() | ||
|
||
def test_eap_restart(web_session): | ||
web_session.logger.info("Begin eap Restart Test") | ||
assert domain_mode_eap_operations(web_session).restart_eap() | ||
|
||
def test_eap_kill(web_session): | ||
web_session.logger.info("Begin eap Kill Test") | ||
assert domain_mode_eap_operations(web_session).kill_eap() | ||
|
||
def test_eap_suspend(web_session): | ||
web_session.logger.info("Begin eap Suspend Test") | ||
assert domain_mode_eap_operations(web_session).suspend_eap() | ||
|
||
def test_eap_resume(web_session): | ||
web_session.logger.info("Begin eap Resume Test") | ||
assert domain_mode_eap_operations(web_session).resume_eap() | ||
|
||
def test_eap_reload(web_session): | ||
web_session.logger.info("Begin eap Reload Test") | ||
assert domain_mode_eap_operations(web_session).reload_eap() | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
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,98 @@ | ||
from common.ui_utils import ui_utils | ||
from selenium.webdriver.support.ui import WebDriverWait | ||
from selenium.webdriver.common.by import By | ||
from time import sleep | ||
from selenium import webdriver | ||
from selenium.webdriver.common.keys import Keys | ||
''' | ||
|
||
Created on December 15, 2016 | ||
|
||
@author: pyadav | ||
|
||
''' | ||
|
||
class domain_mode_eap_operations(): | ||
|
||
web_session = None | ||
|
||
def __init__(self, web_session): | ||
|
||
self.web_session = web_session | ||
self.web_driver = web_session.web_driver | ||
|
||
def find_domain_mode_eap_power(self): | ||
self.web_session.web_driver.get("{}/middleware_domain/show_list".format(self.web_session.MIQ_URL)) | ||
assert ui_utils(self.web_session).waitForTextOnPage("Middleware Domains", 15) | ||
self.web_session.web_driver.find_element_by_xpath("//td[contains(.,'master')]").click() | ||
assert ui_utils(self.web_session).waitForTextOnPage("master (Summary)", 15) | ||
self.web_session.web_driver.find_element_by_xpath("//td[contains(.,'Middleware Server Groups')]").click() | ||
assert ui_utils(self.web_session).waitForTextOnPage("Server Group Name", 15) | ||
self.web_session.web_driver.find_element_by_xpath("//td[contains(.,'main-server-group')]").click() | ||
assert ui_utils(self.web_session).waitForTextOnPage("main-server-group (Summary)", 15) | ||
self.web_session.web_driver.find_element_by_xpath("//td[contains(.,'Middleware Servers')]").click() | ||
assert ui_utils(self.web_session).waitForTextOnPage("Server Name", 15) | ||
self.web_session.web_driver.find_element_by_xpath("//td[contains(.,'server-one')]").click() | ||
assert ui_utils(self.web_session).waitForTextOnPage("Properties", 15) | ||
self.web_session.web_driver.find_element_by_xpath("//button[@title='Power']").click() | ||
|
||
|
||
|
||
def stop_eap(self): | ||
self.find_domain_mode_eap_power() | ||
self.web_session.web_driver.find_element_by_xpath("//a[@title='Stop this server']").click() | ||
ui_utils(self.web_session).accept_alert(20) | ||
assert ui_utils(self.web_session).waitForTextOnPage("Stop initiated for selected server(s)", 30) | ||
return True | ||
|
||
def restart_eap(self): | ||
self.find_domain_mode_eap_power() | ||
self.web_session.web_driver.find_element_by_xpath("//a[@title='Restart this server']").click() | ||
ui_utils(self.web_session).accept_alert(20) | ||
assert ui_utils(self.web_session).waitForTextOnPage("Restart initiated for selected server(s)", 15) | ||
return True | ||
|
||
def kill_eap(self): | ||
self.find_domain_mode_eap_power() | ||
self.web_session.web_driver.find_element_by_xpath("//a[@title='Kill this server']").click() | ||
ui_utils(self.web_session).accept_alert(20) | ||
assert ui_utils(self.web_session).waitForTextOnPage("Kill initiated for selected server(s)", 15) | ||
self.start_eap() #Start EAP to perform other operation Tests | ||
return True | ||
|
||
def reload_eap(self): | ||
self.find_domain_mode_eap_power() | ||
self.web_session.web_driver.find_element_by_xpath("//a[contains(@id,'reload')]").click() | ||
ui_utils(self.web_session).accept_alert(20) | ||
assert ui_utils(self.web_session).waitForTextOnPage("Reload initiated for selected server(s)", 15) | ||
return True | ||
|
||
def suspend_eap(self): | ||
self.find_domain_mode_eap_power() | ||
self.web_session.web_driver.find_element_by_xpath("//a[contains(@id,'suspend')]").click() | ||
ui_utils(self.web_session).sleep(10) | ||
self.web_session.web_driver.find_element_by_xpath("//button[@alt='Suspend']").click() | ||
assert ui_utils(self.web_session).waitForTextOnPage("Suspend initiated for selected server(s)", 15) | ||
return True | ||
|
||
def resume_eap(self): | ||
self.find_domain_mode_eap_power() | ||
self.web_session.web_driver.find_element_by_xpath("//a[contains(@id,'resume')]").click() | ||
ui_utils(self.web_session).accept_alert(20) | ||
ui_utils(self.web_session).sleep(10) | ||
assert ui_utils(self.web_session).waitForTextOnPage("Resume initiated for selected server(s)", 15) | ||
return True | ||
|
||
def start_eap(self): | ||
self.find_domain_mode_eap_power() | ||
self.web_session.web_driver.find_element_by_xpath("//a[contains(@title,'Start this server')]").click() | ||
ui_utils(self.web_session).accept_alert(20) | ||
assert ui_utils(self.web_session).waitForTextOnPage("Start initiated for selected server(s)", 20) | ||
return True | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could domains.nav_to_all_middleware_server_groups be used to navigate to Server Groups?
Seems that each caller should find a server which is in a specific state.
For example, suspending an EAP that is already in suspend state would not be a valid test since the EAP is already in the state for which the poser operation is requesting.
If there are no Domain EAPs in desire state, the test case should gracefully handle such. We may want to start using features such as pytest.skip() to indicate that a test case was not run, in this case due to a Domain server not being available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working on this