diff --git a/automation/Libs/TempTestCase1522072709057.groovy b/automation/Libs/TempTestCase1522072709057.groovy new file mode 100644 index 0000000000000000000000000000000000000000..8f3f2ad60a6c8c73cd635253e450c1d7333ee000 --- /dev/null +++ b/automation/Libs/TempTestCase1522072709057.groovy @@ -0,0 +1,25 @@ +import com.kms.katalon.core.main.TestCaseMain +import com.kms.katalon.core.logging.KeywordLogger +import groovy.lang.MissingPropertyException +import com.kms.katalon.core.testcase.TestCaseBinding +import com.kms.katalon.core.driver.internal.DriverCleanerCollector +import com.kms.katalon.core.model.FailureHandling +import com.kms.katalon.core.configuration.RunConfiguration +import com.kms.katalon.core.webui.contribution.WebUiDriverCleaner +import com.kms.katalon.core.mobile.contribution.MobileDriverCleaner + + +DriverCleanerCollector.getInstance().addDriverCleaner(new com.kms.katalon.core.webui.contribution.WebUiDriverCleaner()) +DriverCleanerCollector.getInstance().addDriverCleaner(new com.kms.katalon.core.mobile.contribution.MobileDriverCleaner()) + + +RunConfiguration.setExecutionSettingFile('/var/folders/3h/5jvs258x4lng1yz2s32ryr4r0000gn/T/Katalon/Test Cases/Add new manuscript/Add a new manuscript/20180326_165829/execution.properties') + +TestCaseMain.beforeStart() +try { + + TestCaseMain.runTestCase('Test Cases/Add new manuscript/Add a new manuscript', new TestCaseBinding('Test Cases/Add new manuscript/Add a new manuscript', [:]), FailureHandling.STOP_ON_FAILURE ) + +} catch (Exception e) { + TestCaseMain.logError(e, 'Test Cases/Add new manuscript/Add a new manuscript') +} diff --git a/automation/Libs/TempTestCase1522072851120.groovy b/automation/Libs/TempTestCase1522072851120.groovy new file mode 100644 index 0000000000000000000000000000000000000000..5ffd33fd18be7c08fb1682470335b135496fe8da --- /dev/null +++ b/automation/Libs/TempTestCase1522072851120.groovy @@ -0,0 +1,25 @@ +import com.kms.katalon.core.main.TestCaseMain +import com.kms.katalon.core.logging.KeywordLogger +import groovy.lang.MissingPropertyException +import com.kms.katalon.core.testcase.TestCaseBinding +import com.kms.katalon.core.driver.internal.DriverCleanerCollector +import com.kms.katalon.core.model.FailureHandling +import com.kms.katalon.core.configuration.RunConfiguration +import com.kms.katalon.core.webui.contribution.WebUiDriverCleaner +import com.kms.katalon.core.mobile.contribution.MobileDriverCleaner + + +DriverCleanerCollector.getInstance().addDriverCleaner(new com.kms.katalon.core.webui.contribution.WebUiDriverCleaner()) +DriverCleanerCollector.getInstance().addDriverCleaner(new com.kms.katalon.core.mobile.contribution.MobileDriverCleaner()) + + +RunConfiguration.setExecutionSettingFile('/var/folders/3h/5jvs258x4lng1yz2s32ryr4r0000gn/T/Katalon/Test Cases/Add new manuscript/Add a new manuscript/20180326_170051/execution.properties') + +TestCaseMain.beforeStart() +try { + + TestCaseMain.runTestCase('Test Cases/Add new manuscript/Add a new manuscript', new TestCaseBinding('Test Cases/Add new manuscript/Add a new manuscript', [:]), FailureHandling.STOP_ON_FAILURE ) + +} catch (Exception e) { + TestCaseMain.logError(e, 'Test Cases/Add new manuscript/Add a new manuscript') +} diff --git a/automation/Libs/TempTestCase1522072933853.groovy b/automation/Libs/TempTestCase1522072933853.groovy new file mode 100644 index 0000000000000000000000000000000000000000..2261a70c8d171e11f8e299a7a135b2154bd94417 --- /dev/null +++ b/automation/Libs/TempTestCase1522072933853.groovy @@ -0,0 +1,25 @@ +import com.kms.katalon.core.main.TestCaseMain +import com.kms.katalon.core.logging.KeywordLogger +import groovy.lang.MissingPropertyException +import com.kms.katalon.core.testcase.TestCaseBinding +import com.kms.katalon.core.driver.internal.DriverCleanerCollector +import com.kms.katalon.core.model.FailureHandling +import com.kms.katalon.core.configuration.RunConfiguration +import com.kms.katalon.core.webui.contribution.WebUiDriverCleaner +import com.kms.katalon.core.mobile.contribution.MobileDriverCleaner + + +DriverCleanerCollector.getInstance().addDriverCleaner(new com.kms.katalon.core.webui.contribution.WebUiDriverCleaner()) +DriverCleanerCollector.getInstance().addDriverCleaner(new com.kms.katalon.core.mobile.contribution.MobileDriverCleaner()) + + +RunConfiguration.setExecutionSettingFile('/var/folders/3h/5jvs258x4lng1yz2s32ryr4r0000gn/T/Katalon/Test Cases/Add new manuscript/Add a new manuscript/20180326_170213/execution.properties') + +TestCaseMain.beforeStart() +try { + + TestCaseMain.runTestCase('Test Cases/Add new manuscript/Add a new manuscript', new TestCaseBinding('Test Cases/Add new manuscript/Add a new manuscript', [:]), FailureHandling.STOP_ON_FAILURE ) + +} catch (Exception e) { + TestCaseMain.logError(e, 'Test Cases/Add new manuscript/Add a new manuscript') +} diff --git a/automation/Libs/TempTestCase1522073064337.groovy b/automation/Libs/TempTestCase1522073064337.groovy new file mode 100644 index 0000000000000000000000000000000000000000..bb374d11a8a4d8d6e62e894a7b02aee9d9d07089 --- /dev/null +++ b/automation/Libs/TempTestCase1522073064337.groovy @@ -0,0 +1,25 @@ +import com.kms.katalon.core.main.TestCaseMain +import com.kms.katalon.core.logging.KeywordLogger +import groovy.lang.MissingPropertyException +import com.kms.katalon.core.testcase.TestCaseBinding +import com.kms.katalon.core.driver.internal.DriverCleanerCollector +import com.kms.katalon.core.model.FailureHandling +import com.kms.katalon.core.configuration.RunConfiguration +import com.kms.katalon.core.webui.contribution.WebUiDriverCleaner +import com.kms.katalon.core.mobile.contribution.MobileDriverCleaner + + +DriverCleanerCollector.getInstance().addDriverCleaner(new com.kms.katalon.core.webui.contribution.WebUiDriverCleaner()) +DriverCleanerCollector.getInstance().addDriverCleaner(new com.kms.katalon.core.mobile.contribution.MobileDriverCleaner()) + + +RunConfiguration.setExecutionSettingFile('/var/folders/3h/5jvs258x4lng1yz2s32ryr4r0000gn/T/Katalon/Test Cases/Add new manuscript/Add a new manuscript/20180326_170424/execution.properties') + +TestCaseMain.beforeStart() +try { + + TestCaseMain.runTestCase('Test Cases/Add new manuscript/Add a new manuscript', new TestCaseBinding('Test Cases/Add new manuscript/Add a new manuscript', [:]), FailureHandling.STOP_ON_FAILURE ) + +} catch (Exception e) { + TestCaseMain.logError(e, 'Test Cases/Add new manuscript/Add a new manuscript') +} diff --git a/automation/Libs/TempTestCase1522073772044.groovy b/automation/Libs/TempTestCase1522073772044.groovy new file mode 100644 index 0000000000000000000000000000000000000000..9db3b751d58839db26ba451c011dc3b81a70c838 --- /dev/null +++ b/automation/Libs/TempTestCase1522073772044.groovy @@ -0,0 +1,25 @@ +import com.kms.katalon.core.main.TestCaseMain +import com.kms.katalon.core.logging.KeywordLogger +import groovy.lang.MissingPropertyException +import com.kms.katalon.core.testcase.TestCaseBinding +import com.kms.katalon.core.driver.internal.DriverCleanerCollector +import com.kms.katalon.core.model.FailureHandling +import com.kms.katalon.core.configuration.RunConfiguration +import com.kms.katalon.core.webui.contribution.WebUiDriverCleaner +import com.kms.katalon.core.mobile.contribution.MobileDriverCleaner + + +DriverCleanerCollector.getInstance().addDriverCleaner(new com.kms.katalon.core.webui.contribution.WebUiDriverCleaner()) +DriverCleanerCollector.getInstance().addDriverCleaner(new com.kms.katalon.core.mobile.contribution.MobileDriverCleaner()) + + +RunConfiguration.setExecutionSettingFile('/var/folders/3h/5jvs258x4lng1yz2s32ryr4r0000gn/T/Katalon/Test Cases/Add new manuscript/Add a new manuscript/20180326_171612/execution.properties') + +TestCaseMain.beforeStart() +try { + + TestCaseMain.runTestCase('Test Cases/Add new manuscript/Add a new manuscript', new TestCaseBinding('Test Cases/Add new manuscript/Add a new manuscript', [:]), FailureHandling.STOP_ON_FAILURE ) + +} catch (Exception e) { + TestCaseMain.logError(e, 'Test Cases/Add new manuscript/Add a new manuscript') +} diff --git a/automation/Libs/TempTestCase1522074225509.groovy b/automation/Libs/TempTestCase1522074225509.groovy new file mode 100644 index 0000000000000000000000000000000000000000..44d5a45be3f41463ff0ed8a8ed68fae9c79d19a0 --- /dev/null +++ b/automation/Libs/TempTestCase1522074225509.groovy @@ -0,0 +1,25 @@ +import com.kms.katalon.core.main.TestCaseMain +import com.kms.katalon.core.logging.KeywordLogger +import groovy.lang.MissingPropertyException +import com.kms.katalon.core.testcase.TestCaseBinding +import com.kms.katalon.core.driver.internal.DriverCleanerCollector +import com.kms.katalon.core.model.FailureHandling +import com.kms.katalon.core.configuration.RunConfiguration +import com.kms.katalon.core.webui.contribution.WebUiDriverCleaner +import com.kms.katalon.core.mobile.contribution.MobileDriverCleaner + + +DriverCleanerCollector.getInstance().addDriverCleaner(new com.kms.katalon.core.webui.contribution.WebUiDriverCleaner()) +DriverCleanerCollector.getInstance().addDriverCleaner(new com.kms.katalon.core.mobile.contribution.MobileDriverCleaner()) + + +RunConfiguration.setExecutionSettingFile('/var/folders/3h/5jvs258x4lng1yz2s32ryr4r0000gn/T/Katalon/Test Cases/Add new manuscript/Add a new manuscript/20180326_172345/execution.properties') + +TestCaseMain.beforeStart() +try { + + TestCaseMain.runTestCase('Test Cases/Add new manuscript/Add a new manuscript', new TestCaseBinding('Test Cases/Add new manuscript/Add a new manuscript', [:]), FailureHandling.STOP_ON_FAILURE ) + +} catch (Exception e) { + TestCaseMain.logError(e, 'Test Cases/Add new manuscript/Add a new manuscript') +} diff --git a/automation/Object Repository/EditUser/Professor.rs b/automation/Object Repository/EditUser/Professor.rs new file mode 100644 index 0000000000000000000000000000000000000000..d973c2fa81111f17e5ea3817a8ad298e524143ef --- /dev/null +++ b/automation/Object Repository/EditUser/Professor.rs @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<WebElementEntity> + <description></description> + <name>Professor</name> + <tag></tag> + <elementGuidId>eba9b5bd-3de2-4ba0-87a2-6de8cb955713</elementGuidId> + <selectorCollection> + <entry> + <key>BASIC</key> + <value></value> + </entry> + <entry> + <key>XPATH</key> + <value>//div[contains(text(),"Professor")]</value> + </entry> + </selectorCollection> + <selectorMethod>XPATH</selectorMethod> + <useRalativeImagePath>false</useRalativeImagePath> +</WebElementEntity> diff --git a/automation/Object Repository/NewUser/a_Edit.rs b/automation/Object Repository/EditUser/a_Edit.rs similarity index 90% rename from automation/Object Repository/NewUser/a_Edit.rs rename to automation/Object Repository/EditUser/a_Edit.rs index e17c1daea2784b0d054271f634a1300ec7579677..ca57d84e7ff91d78f55a2f1069168cdcc056603b 100644 --- a/automation/Object Repository/NewUser/a_Edit.rs +++ b/automation/Object Repository/EditUser/a_Edit.rs @@ -7,10 +7,14 @@ <selectorCollection> <entry> <key>CSS</key> - <value>#root > div > div > div.sc-drKuOJ.fmUpkt > div > table > tbody > tr:nth-child(1) > td:nth-child(7) > a</value> + <value></value> + </entry> + <entry> + <key>XPATH</key> + <value>//a[contains(text(),"Edit")]</value> </entry> </selectorCollection> - <selectorMethod>CSS</selectorMethod> + <selectorMethod>XPATH</selectorMethod> <useRalativeImagePath>false</useRalativeImagePath> <webElementProperties> <isSelected>true</isSelected> diff --git a/automation/Object Repository/EditUser/admin.rs b/automation/Object Repository/EditUser/admin.rs new file mode 100644 index 0000000000000000000000000000000000000000..82a0afcaa332668e670891a93921bb82fb50df95 --- /dev/null +++ b/automation/Object Repository/EditUser/admin.rs @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<WebElementEntity> + <description></description> + <name>admin</name> + <tag></tag> + <elementGuidId>f8d9253b-e777-4c8e-a9f9-c9853441ccf3</elementGuidId> + <selectorCollection> + <entry> + <key>BASIC</key> + <value></value> + </entry> + <entry> + <key>XPATH</key> + <value>//span[contains(text(),"Admin")]</value> + </entry> + <entry> + <key>CSS</key> + <value></value> + </entry> + </selectorCollection> + <selectorMethod>XPATH</selectorMethod> + <useRalativeImagePath>false</useRalativeImagePath> +</WebElementEntity> diff --git a/automation/Object Repository/EditUser/affiliation.rs b/automation/Object Repository/EditUser/affiliation.rs new file mode 100644 index 0000000000000000000000000000000000000000..12d8913a2cdaec6e1e4189fc1594b81b0ccbd2f9 --- /dev/null +++ b/automation/Object Repository/EditUser/affiliation.rs @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<WebElementEntity> + <description></description> + <name>affiliation</name> + <tag></tag> + <elementGuidId>4291041c-0bce-4713-af17-89c652ba2531</elementGuidId> + <selectorCollection> + <entry> + <key>BASIC</key> + <value></value> + </entry> + <entry> + <key>CSS</key> + <value>input[name="affiliation"]</value> + </entry> + </selectorCollection> + <selectorMethod>CSS</selectorMethod> + <useRalativeImagePath>false</useRalativeImagePath> +</WebElementEntity> diff --git a/automation/Object Repository/EditUser/author.rs b/automation/Object Repository/EditUser/author.rs new file mode 100644 index 0000000000000000000000000000000000000000..45e78c6193cd8221bc416a397156cabae0442a5b --- /dev/null +++ b/automation/Object Repository/EditUser/author.rs @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<WebElementEntity> + <description></description> + <name>author</name> + <tag></tag> + <elementGuidId>201e73e0-b947-4620-bf6d-2596ed72498c</elementGuidId> + <selectorCollection> + <entry> + <key>BASIC</key> + <value></value> + </entry> + <entry> + <key>CSS</key> + <value>input[name="author"]</value> + </entry> + </selectorCollection> + <selectorMethod>CSS</selectorMethod> + <useRalativeImagePath>false</useRalativeImagePath> +</WebElementEntity> diff --git a/automation/Object Repository/EditUser/back.rs b/automation/Object Repository/EditUser/back.rs new file mode 100644 index 0000000000000000000000000000000000000000..4c859ed9550899fae5db9acd6d198915f670f9b7 --- /dev/null +++ b/automation/Object Repository/EditUser/back.rs @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<WebElementEntity> + <description></description> + <name>back</name> + <tag></tag> + <elementGuidId>67040fc1-b9eb-4a70-8d63-2ef93cdf0b28</elementGuidId> + <selectorCollection> + <entry> + <key>BASIC</key> + <value></value> + </entry> + <entry> + <key>XPATH</key> + <value>//button[contains(text(),"Back")]</value> + </entry> + </selectorCollection> + <selectorMethod>XPATH</selectorMethod> + <useRalativeImagePath>false</useRalativeImagePath> +</WebElementEntity> diff --git a/automation/Object Repository/EditUser/editorInChief.rs b/automation/Object Repository/EditUser/editorInChief.rs new file mode 100644 index 0000000000000000000000000000000000000000..2328672ff96b2df3268f39b91c8376d30c64a698 --- /dev/null +++ b/automation/Object Repository/EditUser/editorInChief.rs @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<WebElementEntity> + <description></description> + <name>editorInChief</name> + <tag></tag> + <elementGuidId>d868d422-04b5-4c62-b4a8-901287c62d0d</elementGuidId> + <selectorCollection> + <entry> + <key>BASIC</key> + <value></value> + </entry> + <entry> + <key>XPATH</key> + <value>//span[contains(text(),"Editor")]</value> + </entry> + <entry> + <key>CSS</key> + <value></value> + </entry> + </selectorCollection> + <selectorMethod>XPATH</selectorMethod> + <useRalativeImagePath>false</useRalativeImagePath> +</WebElementEntity> diff --git a/automation/Object Repository/EditUser/firstName.rs b/automation/Object Repository/EditUser/firstName.rs new file mode 100644 index 0000000000000000000000000000000000000000..21476084409e0cea32b77a08d7e4988955b414a5 --- /dev/null +++ b/automation/Object Repository/EditUser/firstName.rs @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<WebElementEntity> + <description></description> + <name>firstName</name> + <tag></tag> + <elementGuidId>6a96a983-234f-41e9-ae31-2049b21d0559</elementGuidId> + <selectorCollection> + <entry> + <key>BASIC</key> + <value></value> + </entry> + <entry> + <key>CSS</key> + <value>input[name="firstName"]</value> + </entry> + </selectorCollection> + <selectorMethod>CSS</selectorMethod> + <useRalativeImagePath>false</useRalativeImagePath> +</WebElementEntity> diff --git a/automation/Object Repository/EditUser/lastName.rs b/automation/Object Repository/EditUser/lastName.rs new file mode 100644 index 0000000000000000000000000000000000000000..41e8f510fa5d9a8d0bebb8d0c8a0557ce0850e0b --- /dev/null +++ b/automation/Object Repository/EditUser/lastName.rs @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<WebElementEntity> + <description></description> + <name>lastName</name> + <tag></tag> + <elementGuidId>9fdd634e-efe0-41a9-bd7e-e3dabdab2c42</elementGuidId> + <selectorCollection> + <entry> + <key>BASIC</key> + <value></value> + </entry> + <entry> + <key>CSS</key> + <value>input[name="lastName"]</value> + </entry> + </selectorCollection> + <selectorMethod>CSS</selectorMethod> + <useRalativeImagePath>false</useRalativeImagePath> +</WebElementEntity> diff --git a/automation/Object Repository/EditUser/save.rs b/automation/Object Repository/EditUser/save.rs new file mode 100644 index 0000000000000000000000000000000000000000..1fe9d20d5e86e6abb3f6143d22bc5a80c3a7a2f4 --- /dev/null +++ b/automation/Object Repository/EditUser/save.rs @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<WebElementEntity> + <description></description> + <name>save</name> + <tag></tag> + <elementGuidId>5459e992-448c-44a0-9afc-90c27303e61d</elementGuidId> + <selectorCollection> + <entry> + <key>BASIC</key> + <value></value> + </entry> + <entry> + <key>CSS</key> + <value>button[type="submit"]</value> + </entry> + </selectorCollection> + <selectorMethod>CSS</selectorMethod> + <useRalativeImagePath>false</useRalativeImagePath> +</WebElementEntity> diff --git a/automation/Object Repository/NewUser/td_vlad.stegarunewuserthinslic.rs b/automation/Object Repository/EditUser/td_admin.rs similarity index 87% rename from automation/Object Repository/NewUser/td_vlad.stegarunewuserthinslic.rs rename to automation/Object Repository/EditUser/td_admin.rs index f4ef7825b8ff65cf36154ff32576a771dc69eb52..e5cf0c4e6029445b9d3015b825312ce35a217e08 100644 --- a/automation/Object Repository/NewUser/td_vlad.stegarunewuserthinslic.rs +++ b/automation/Object Repository/EditUser/td_admin.rs @@ -1,20 +1,20 @@ <?xml version="1.0" encoding="UTF-8"?> <WebElementEntity> <description></description> - <name>td_vlad.stegarunewuserthinslic</name> + <name>td_admin</name> <tag></tag> <elementGuidId>1ee7b131-9b37-44ca-a75a-e710f5aa3d91</elementGuidId> <selectorCollection> <entry> <key>CSS</key> - <value>#root > div > div > div.sc-drKuOJ.fmUpkt > div > table > tbody > tr:nth-child(1)</value> + <value></value> </entry> <entry> <key>XPATH</key> - <value></value> + <value>//td[contains(text(),"admin@mailinator.com")]</value> </entry> </selectorCollection> - <selectorMethod>CSS</selectorMethod> + <selectorMethod>XPATH</selectorMethod> <useRalativeImagePath>false</useRalativeImagePath> <webElementProperties> <isSelected>true</isSelected> diff --git a/automation/Object Repository/EditUser/titleDropDown.rs b/automation/Object Repository/EditUser/titleDropDown.rs new file mode 100644 index 0000000000000000000000000000000000000000..5294e6e153bfd4b9477fb4f3a5d8c492dcac42f2 --- /dev/null +++ b/automation/Object Repository/EditUser/titleDropDown.rs @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<WebElementEntity> + <description></description> + <name>titleDropDown</name> + <tag></tag> + <elementGuidId>81a68a81-b445-4092-96fe-b97761eb9fda</elementGuidId> + <selectorCollection> + <entry> + <key>BASIC</key> + <value></value> + </entry> + <entry> + <key>CSS</key> + <value>div[role="listbox"] button</value> + </entry> + </selectorCollection> + <selectorMethod>CSS</selectorMethod> + <useRalativeImagePath>false</useRalativeImagePath> +</WebElementEntity> diff --git a/automation/Object Repository/NewManuscript/manuscriptAuthorsDetails/review.rs b/automation/Object Repository/NewManuscript/manuscriptAuthorsDetails/Research.rs similarity index 92% rename from automation/Object Repository/NewManuscript/manuscriptAuthorsDetails/review.rs rename to automation/Object Repository/NewManuscript/manuscriptAuthorsDetails/Research.rs index e66280690df4154ad82d5010f81876646e19425c..68e88ae9fb54802a9938dc0096ae45a4f9a3ae6d 100644 --- a/automation/Object Repository/NewManuscript/manuscriptAuthorsDetails/review.rs +++ b/automation/Object Repository/NewManuscript/manuscriptAuthorsDetails/Research.rs @@ -1,19 +1,20 @@ <?xml version="1.0" encoding="UTF-8"?> <WebElementEntity> <description></description> - <name>review</name> + <name>Research</name> <tag></tag> <elementGuidId>073d58c9-eab0-4bda-b090-aa974ebc3bd3</elementGuidId> <selectorCollection> <entry> <key>CSS</key> - <value>div[data-test="metadata.type"] div[role="listbox"] div div:nth-child(2)</value> + <value></value> </entry> <entry> <key>XPATH</key> + <value>//div[contains(text(),"Research")]</value> </entry> </selectorCollection> - <selectorMethod>CSS</selectorMethod> + <selectorMethod>XPATH</selectorMethod> <useRalativeImagePath>false</useRalativeImagePath> <webElementProperties> <isSelected>true</isSelected> diff --git a/automation/Object Repository/NewManuscript/manuscriptAuthorsDetails/addAuthor.rs b/automation/Object Repository/NewManuscript/manuscriptAuthorsDetails/addAuthor.rs index ec2b83eba468bbd8c034f0fea778473b7ee9c26f..feea6a717aba7b046910a118e62c552fc8e6cd2e 100644 --- a/automation/Object Repository/NewManuscript/manuscriptAuthorsDetails/addAuthor.rs +++ b/automation/Object Repository/NewManuscript/manuscriptAuthorsDetails/addAuthor.rs @@ -5,12 +5,16 @@ <tag></tag> <elementGuidId>e12e5c46-5ca1-4e4f-96cb-467b1aa9be59</elementGuidId> <selectorCollection> + <entry> + <key>CSS</key> + <value>button[data-test="button-add-author"]</value> + </entry> <entry> <key>XPATH</key> - <value>//div[@data-test="authors"]/div/div/button</value> + <value></value> </entry> </selectorCollection> - <selectorMethod>XPATH</selectorMethod> + <selectorMethod>CSS</selectorMethod> <useRalativeImagePath>false</useRalativeImagePath> <webElementProperties> <isSelected>true</isSelected> diff --git a/automation/Object Repository/NewManuscript/manuscriptAuthorsDetails/countryOption.rs b/automation/Object Repository/NewManuscript/manuscriptAuthorsDetails/countryOption.rs index 3b738783d333af3dfde775752ffffc98dec783b2..332357bff0845a04dfd17be33a79881bc4f9e76e 100644 --- a/automation/Object Repository/NewManuscript/manuscriptAuthorsDetails/countryOption.rs +++ b/automation/Object Repository/NewManuscript/manuscriptAuthorsDetails/countryOption.rs @@ -7,14 +7,14 @@ <selectorCollection> <entry> <key>CSS</key> - <value>div[data-test="authors"] div[role="listbox"] div div:nth-child(46)</value> + <value></value> </entry> <entry> <key>XPATH</key> - <value></value> + <value>//div[contains(text(),"Japan")]</value> </entry> </selectorCollection> - <selectorMethod>CSS</selectorMethod> + <selectorMethod>XPATH</selectorMethod> <useRalativeImagePath>false</useRalativeImagePath> <webElementProperties> <isSelected>true</isSelected> diff --git a/automation/Object Repository/NewManuscript/manuscriptAuthorsDetails/no.rs b/automation/Object Repository/NewManuscript/manuscriptAuthorsDetails/no.rs index 34f6b7c3f8ceced9599d8e75738c71966d936ced..b66aa5cadaeb299338093344c70fcaa5ed0c052b 100644 --- a/automation/Object Repository/NewManuscript/manuscriptAuthorsDetails/no.rs +++ b/automation/Object Repository/NewManuscript/manuscriptAuthorsDetails/no.rs @@ -7,7 +7,7 @@ <selectorCollection> <entry> <key>CSS</key> - <value>div[data-test="conflicts.hasConflicts"] div div label:nth-child(2)</value> + <value>input[type="radio"][value="no"]+ span</value> </entry> <entry> <key>XPATH</key> diff --git a/automation/Object Repository/NewManuscript/manuscriptAuthorsDetails/submittingAuthor.rs b/automation/Object Repository/NewManuscript/manuscriptAuthorsDetails/submittingAuthor.rs new file mode 100644 index 0000000000000000000000000000000000000000..7f1f43993d5f2fa4d02661e5975ed4e22b5a5b23 --- /dev/null +++ b/automation/Object Repository/NewManuscript/manuscriptAuthorsDetails/submittingAuthor.rs @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<WebElementEntity> + <description></description> + <name>submittingAuthor</name> + <tag></tag> + <elementGuidId>7b2fcac6-fd34-438e-90f8-d4d3824e6f2d</elementGuidId> + <selectorCollection> + <entry> + <key>BASIC</key> + <value></value> + </entry> + <entry> + <key>XPATH</key> + <value>//span[contains(text(),"#")]</value> + </entry> + <entry> + <key>CSS</key> + <value></value> + </entry> + </selectorCollection> + <selectorMethod>XPATH</selectorMethod> + <useRalativeImagePath>false</useRalativeImagePath> +</WebElementEntity> diff --git a/automation/Object Repository/NewManuscript/manuscriptAuthorsDetails/yes.rs b/automation/Object Repository/NewManuscript/manuscriptAuthorsDetails/yes.rs index b7023f937f29497e1c401f9c14675ae8d35e41cb..0c6f6ffdda25eca958e32e50b34dc9e1f15e2faf 100644 --- a/automation/Object Repository/NewManuscript/manuscriptAuthorsDetails/yes.rs +++ b/automation/Object Repository/NewManuscript/manuscriptAuthorsDetails/yes.rs @@ -7,7 +7,7 @@ <selectorCollection> <entry> <key>CSS</key> - <value></value> + <value>input[type="radio"][value="yes"]+ span</value> </entry> </selectorCollection> <selectorMethod>CSS</selectorMethod> diff --git a/automation/Object Repository/NewManuscript/manuscriptFilesUpload/Back.rs b/automation/Object Repository/NewManuscript/manuscriptFilesUpload/Back.rs new file mode 100644 index 0000000000000000000000000000000000000000..1dda5f6dcf020ae56d1d43c2d4f3ff148d836bfd --- /dev/null +++ b/automation/Object Repository/NewManuscript/manuscriptFilesUpload/Back.rs @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<WebElementEntity> + <description></description> + <name>Back</name> + <tag></tag> + <elementGuidId>8b3ed9c6-1888-48f9-99e2-45a08d149de1</elementGuidId> + <selectorCollection> + <entry> + <key>BASIC</key> + <value></value> + </entry> + <entry> + <key>CSS</key> + <value>button[data-test="button-prev"]</value> + </entry> + </selectorCollection> + <selectorMethod>CSS</selectorMethod> + <useRalativeImagePath>false</useRalativeImagePath> +</WebElementEntity> diff --git a/automation/Object Repository/NewManuscript/manuscriptFilesUpload/attachFile.rs b/automation/Object Repository/NewManuscript/manuscriptFilesUpload/attachManuscript.rs similarity index 94% rename from automation/Object Repository/NewManuscript/manuscriptFilesUpload/attachFile.rs rename to automation/Object Repository/NewManuscript/manuscriptFilesUpload/attachManuscript.rs index f25d661ba3d243ddf48136f6a7ff1a5d8a8c67ae..16ece3ecbcff3a799d50292e0d3ef9489f8af04a 100644 --- a/automation/Object Repository/NewManuscript/manuscriptFilesUpload/attachFile.rs +++ b/automation/Object Repository/NewManuscript/manuscriptFilesUpload/attachManuscript.rs @@ -1,20 +1,20 @@ <?xml version="1.0" encoding="UTF-8"?> <WebElementEntity> <description></description> - <name>attachFile</name> + <name>attachManuscript</name> <tag></tag> <elementGuidId>c3eed726-7b7f-4e93-8d4a-baddc5a31314</elementGuidId> <selectorCollection> <entry> <key>CSS</key> - <value></value> + <value>div[data-test="button-upload-manuscripts"]</value> </entry> <entry> <key>XPATH</key> - <value>//*[@id="root"]/div/div[2]/div/div[2]/form/div[1]/div/div/div[2]/div[1]/div/div</value> + <value></value> </entry> </selectorCollection> - <selectorMethod>XPATH</selectorMethod> + <selectorMethod>CSS</selectorMethod> <useRalativeImagePath>false</useRalativeImagePath> <webElementProperties> <isSelected>true</isSelected> diff --git a/automation/Object Repository/NewManuscript/preSubmissionChecklist/hasManuscript.rs b/automation/Object Repository/NewManuscript/preSubmissionChecklist/hasManuscript.rs index c89323060ce26a08ba20833c4945dea7a07563eb..d1b0bb852daf6abfea1aa3e9a1f13c55c97d366b 100644 --- a/automation/Object Repository/NewManuscript/preSubmissionChecklist/hasManuscript.rs +++ b/automation/Object Repository/NewManuscript/preSubmissionChecklist/hasManuscript.rs @@ -7,13 +7,14 @@ <selectorCollection> <entry> <key>CSS</key> - <value>div[data-test="declarations"] div label:nth-child(2)</value> + <value></value> </entry> <entry> <key>XPATH</key> + <value>//div[@data-test="declarations"]/div/label/span[contains(text(),'Microsoft')]</value> </entry> </selectorCollection> - <selectorMethod>CSS</selectorMethod> + <selectorMethod>XPATH</selectorMethod> <useRalativeImagePath>false</useRalativeImagePath> <webElementProperties> <isSelected>true</isSelected> diff --git a/automation/Object Repository/NewManuscript/preSubmissionChecklist/hasOrcid.rs b/automation/Object Repository/NewManuscript/preSubmissionChecklist/hasOrcid.rs index aa3c400481b35965841b53741f0b208057e5f186..252614d4bb3197528f15b8c78b24e6f5ccfe7378 100644 --- a/automation/Object Repository/NewManuscript/preSubmissionChecklist/hasOrcid.rs +++ b/automation/Object Repository/NewManuscript/preSubmissionChecklist/hasOrcid.rs @@ -7,14 +7,14 @@ <selectorCollection> <entry> <key>CSS</key> - <value>div[data-test="declarations"] div label:nth-child(5)</value> + <value></value> </entry> <entry> <key>XPATH</key> - <value></value> + <value>//div[@data-test="declarations"]/div/label/span[contains(text(),'ORCID')]</value> </entry> </selectorCollection> - <selectorMethod>CSS</selectorMethod> + <selectorMethod>XPATH</selectorMethod> <useRalativeImagePath>false</useRalativeImagePath> <webElementProperties> <isSelected>true</isSelected> diff --git a/automation/Object Repository/NewUser/EditUser/.meta b/automation/Object Repository/NewUser/EditUser/.meta deleted file mode 100644 index 19883ad9e19e08afbfa1df71deffe0e36eceeaa0..0000000000000000000000000000000000000000 --- a/automation/Object Repository/NewUser/EditUser/.meta +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<FolderEntity> - <description>folder</description> - <name>EditUser</name> - <tag></tag> - <folderType>WEBELEMENT</folderType> -</FolderEntity> diff --git a/automation/Object Repository/NewUser/addUser.rs b/automation/Object Repository/NewUser/addUser.rs index a33b2349946c3274bfc66c1f7dfea9baf220d79b..bf00b8e81cbe44f8a6656e9ef60f9f5fbf8ac36e 100644 --- a/automation/Object Repository/NewUser/addUser.rs +++ b/automation/Object Repository/NewUser/addUser.rs @@ -11,15 +11,10 @@ </entry> <entry> <key>XPATH</key> - <key>XPATH</key> - <value>//button/*[1]</value> - </entry> - <entry> - <key>CSS</key> - <value>button:first-child</value> + <value></value> </entry> </selectorCollection> - <selectorMethod>XPATH</selectorMethod> + <selectorMethod>CSS</selectorMethod> <useRalativeImagePath>false</useRalativeImagePath> <webElementProperties> <isSelected>true</isSelected> diff --git a/automation/Object Repository/NewUser/roleAdmin.rs b/automation/Object Repository/NewUser/roleAdmin.rs index 55581d2b16c2341165a1adb776bf8927a360b735..e0300276226fc4cb9f904175975d2926b4720fce 100644 --- a/automation/Object Repository/NewUser/roleAdmin.rs +++ b/automation/Object Repository/NewUser/roleAdmin.rs @@ -6,13 +6,12 @@ <elementGuidId>e32a2bfe-254a-42d6-b533-255570389045</elementGuidId> <selectorCollection> <entry> - <key>XPATH</key> - <value>div[data-test="role-selector"] button</value> - <value>//div[contains(text(),'Editor in Chief')]</value> + <key>CSS</key> + <value>//div[contains(text(),"Admin")]</value> </entry> <entry> - <key>CSS</key> - <value>div[data-test="role-selector"] div[role="option"]:last-child</value> + <key>XPATH</key> + <value>//div[contains(text(),'Editor in Chief')]</value> </entry> </selectorCollection> <selectorMethod>CSS</selectorMethod> diff --git a/automation/Object Repository/NewUser/users.rs b/automation/Object Repository/NewUser/users.rs index bd2c23d477bd43e405fa7dc04b958aac6ab35372..d15f67c2fff04fc1d95c41256ad14de9976c4c39 100644 --- a/automation/Object Repository/NewUser/users.rs +++ b/automation/Object Repository/NewUser/users.rs @@ -8,15 +8,13 @@ <entry> <key>CSS</key> <value>div[data-test="card-users"]</value> - <key>XPATH</key> - <value>//span[contains(text(),'Users')]</value> </entry> <entry> - <key>CSS</key> - <value>//span[contains(text(),'Users')]</value> + <key>XPATH</key> + <value></value> </entry> </selectorCollection> - <selectorMethod>XPATH</selectorMethod> + <selectorMethod>CSS</selectorMethod> <useRalativeImagePath>false</useRalativeImagePath> <webElementProperties> <isSelected>true</isSelected> diff --git a/automation/Object Repository/SignIn/LoginButton.rs b/automation/Object Repository/SignIn/LoginButton.rs deleted file mode 100644 index 9685dc059d81179f8984ed5535fc78975ce61de5..0000000000000000000000000000000000000000 --- a/automation/Object Repository/SignIn/LoginButton.rs +++ /dev/null @@ -1,50 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<WebElementEntity> - <description></description> - <name>LoginButton</name> - <tag></tag> - <elementGuidId>4bf556e3-9a8c-4577-ac69-f0ba05bf79a6</elementGuidId> - <selectorCollection> - <entry> - <key>CSS</key> - <value>button[type="submit"]</value> - </entry> - </selectorCollection> - <selectorMethod>CSS</selectorMethod> - <useRalativeImagePath>false</useRalativeImagePath> - <webElementProperties> - <isSelected>true</isSelected> - <matchCondition>equals</matchCondition> - <name>tag</name> - <type>Main</type> - <value>button</value> - </webElementProperties> - <webElementProperties> - <isSelected>true</isSelected> - <matchCondition>equals</matchCondition> - <name>type</name> - <type>Main</type> - <value>submit</value> - </webElementProperties> - <webElementProperties> - <isSelected>false</isSelected> - <matchCondition>equals</matchCondition> - <name>class</name> - <type>Main</type> - <value>Login-local_button-2V-wyVs0 sc-kgoBCf jJDfiI</value> - </webElementProperties> - <webElementProperties> - <isSelected>true</isSelected> - <matchCondition>equals</matchCondition> - <name>text</name> - <type>Main</type> - <value>Login</value> - </webElementProperties> - <webElementProperties> - <isSelected>false</isSelected> - <matchCondition>equals</matchCondition> - <name>xpath</name> - <type>Main</type> - <value>id("root")/div[@class="sc-fyjhYU bulmcW"]/div[@class="sc-ugnQR hguLEQ"]/div[@class="Login-local_root-28yxoK4a"]/form[@class="Login-local_form-N-RCy5To"]/button[@class="Login-local_button-2V-wyVs0 sc-kgoBCf jJDfiI"]</value> - </webElementProperties> -</WebElementEntity> diff --git a/automation/Object Repository/NewUser/login.rs b/automation/Object Repository/SignIn/login.rs similarity index 76% rename from automation/Object Repository/NewUser/login.rs rename to automation/Object Repository/SignIn/login.rs index 43a596efe3f0b88cd852a3dee00a5749203b0f9d..26e8a4bdc70546d3f911e06a28e928b8512bd14e 100644 --- a/automation/Object Repository/NewUser/login.rs +++ b/automation/Object Repository/SignIn/login.rs @@ -3,7 +3,7 @@ <description></description> <name>login</name> <tag></tag> - <elementGuidId>13c40cbc-2634-4147-b93b-717f7ea9cc2b</elementGuidId> + <elementGuidId>4bf556e3-9a8c-4577-ac69-f0ba05bf79a6</elementGuidId> <selectorCollection> <entry> <key>CSS</key> @@ -31,7 +31,7 @@ <matchCondition>equals</matchCondition> <name>class</name> <type>Main</type> - <value>sc-jTzLTM jwsELq</value> + <value>Login-local_button-2V-wyVs0 sc-kgoBCf jJDfiI</value> </webElementProperties> <webElementProperties> <isSelected>true</isSelected> @@ -45,6 +45,6 @@ <matchCondition>equals</matchCondition> <name>xpath</name> <type>Main</type> - <value>id("root")/div[@class="sc-cmTdod hZxvxw"]/div[@class="sc-dyGzUR bQYZEl"]/div[@class="sc-drKuOJ fmUpkt"]/div[@class="sc-TOsTZ beQaWr"]/form[1]/button[@class="sc-jTzLTM jwsELq"]</value> + <value>id("root")/div[@class="sc-fyjhYU bulmcW"]/div[@class="sc-ugnQR hguLEQ"]/div[@class="Login-local_root-28yxoK4a"]/form[@class="Login-local_form-N-RCy5To"]/button[@class="Login-local_button-2V-wyVs0 sc-kgoBCf jJDfiI"]</value> </webElementProperties> </WebElementEntity> diff --git a/automation/Object Repository/SignIn/passwordField.rs b/automation/Object Repository/SignIn/password.rs similarity index 98% rename from automation/Object Repository/SignIn/passwordField.rs rename to automation/Object Repository/SignIn/password.rs index 915da59241044a7125adfafbf75623a062b689b6..3a943369d4180b2c7e93816a3f4795af356a0f6b 100644 --- a/automation/Object Repository/SignIn/passwordField.rs +++ b/automation/Object Repository/SignIn/password.rs @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <WebElementEntity> <description></description> - <name>passwordField</name> + <name>password</name> <tag></tag> <elementGuidId>4f096b22-ebe7-4747-99f7-50595df00fae</elementGuidId> <selectorCollection> diff --git a/automation/Object Repository/SignIn/usernameField.rs b/automation/Object Repository/SignIn/username.rs similarity index 97% rename from automation/Object Repository/SignIn/usernameField.rs rename to automation/Object Repository/SignIn/username.rs index 33f5eee37c4bec1df3cbd7e0f6d5b6221bd8a29d..767d407831faa87dd9201b4a39e15754fa3f8283 100644 --- a/automation/Object Repository/SignIn/usernameField.rs +++ b/automation/Object Repository/SignIn/username.rs @@ -1,22 +1,21 @@ <?xml version="1.0" encoding="UTF-8"?> <WebElementEntity> <description></description> - <name>usernameField</name> + <name>username</name> <tag></tag> <elementGuidId>c24bfa98-382a-45ef-9e36-671d6c2276bb</elementGuidId> <selectorCollection> - <entry> - <key>CSS</key> - <value>input[name="username"]</value> - </entry> <entry> <key>XPATH</key> - <value></value> </entry> <entry> <key>BASIC</key> <value>//input[@type = 'text' and @name = 'username']</value> </entry> + <entry> + <key>CSS</key> + <value>input[name="username"]</value> + </entry> </selectorCollection> <selectorMethod>CSS</selectorMethod> <useRalativeImagePath>false</useRalativeImagePath> diff --git a/automation/Scripts/Add a new user/Add a new user/Script1521123804636.groovy b/automation/Scripts/Add a new user/Add a new user/Script1521123804636.groovy index 6ef2f77f01c18d0f9cafbc0e2dcedf3f69d43939..1c0835fc4fcab0e41906322d73afeb0dcaa10ab2 100644 --- a/automation/Scripts/Add a new user/Add a new user/Script1521123804636.groovy +++ b/automation/Scripts/Add a new user/Add a new user/Script1521123804636.groovy @@ -20,87 +20,61 @@ import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI import internal.GlobalVariable as GlobalVariable WebUI.openBrowser(null) - WebUI.navigateToUrl('https://xpub-faraday.now.sh') -username = findTestObject('NewUser/username') - +username = findTestObject('SignIn/username') WebUI.click(username) - WebUI.setText(username, 'admin') -password = findTestObject('NewUser/password') - +password = findTestObject('SignIn/password') WebUI.click(password) - WebUI.setText(password, 'admin123') -login = findTestObject('NewUser/login') - +login = findTestObject('SignIn/login') WebUI.click(login) admin = findTestObject("NewUser/adminButton") WebUI.click(admin) adminDashboard = findTestObject('NewUser/adminDashboard') - WebUI.click(adminDashboard) users = findTestObject('NewUser/users') - WebUI.waitForElementVisible(users, 2) - WebUI.click(users) addUser = findTestObject('NewUser/addUser') - WebUI.click(addUser) email = findTestObject('NewUser/email') - WebUI.click(email) -<<<<<<< HEAD -WebUI.setText(email, 'vlad.stegaru+newestUser@thinslices.com') -======= ->>>>>>> e85cabdf8bb80ea1284bf832b47b990be81d0c03 - +//WebUI.setText(email, 'vlad.stegaru+newestUser@thinslices.com') WebUI.setText(email, 'bogdan.cochior+author@thinslices.com') roleDropDown = findTestObject('NewUser/roleDropDown') - WebUI.click(roleDropDown) author = findTestObject('NewUser/author') - WebUI.click(author) firstName = findTestObject('NewUser/firstName') - WebUI.click(firstName) - WebUI.setText(firstName, 'Bogdan Author') lastName = findTestObject('NewUser/lastName') - WebUI.click(lastName) - WebUI.setText(lastName, 'Test') affiliation = findTestObject('NewUser/affiliation') - WebUI.click(affiliation) - WebUI.setText(affiliation, 'College') title = findTestObject('NewUser/titleDropDown') - WebUI.click(title) dr = findTestObject('NewUser/Dr') - WebUI.click(dr) save = findTestObject('NewUser/save') - WebUI.click(save) diff --git a/automation/Scripts/Add new manuscript/Add a new manuscript/Script1520433593112.groovy b/automation/Scripts/Add new manuscript/Add a new manuscript/Script1520433593112.groovy index ed89330b1da4e2c164ad1afc6900a592cb5c6bd5..c8edce52e91f5e80f3b2e33340d1059caba536ca 100644 --- a/automation/Scripts/Add new manuscript/Add a new manuscript/Script1520433593112.groovy +++ b/automation/Scripts/Add new manuscript/Add a new manuscript/Script1520433593112.groovy @@ -21,39 +21,24 @@ import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI import internal.GlobalVariable as GlobalVariable import org.junit.After as After import org.openqa.selenium.Keys as Keys -import java.util.* -WebUI.openBrowser(null) +WebUI.openBrowser(null) WebUI.navigateToUrl('https://xpub-faraday.now.sh') -username = findTestObject('SignIn/usernameField') - +username = findTestObject('SignIn/username') WebUI.click(username) - WebUI.setText(username, 'admin') -password = findTestObject('SignIn/passwordField') - +password = findTestObject('SignIn/password') WebUI.click(password) - WebUI.setText(password, 'admin123') -loginButton = findTestObject('SignIn/LoginButton') - +loginButton = findTestObject('SignIn/login') WebUI.click(loginButton) -/*manuscriptBoard = findTestObject("Resume/manuscriptBoard") - -def manuscriptIds = [] -for(i= 0; i=manuscriptIds.size(); i++){ - - manuscriptIds << newButton = findTestObject('NewManuscript/journalfFieldSelection/New') - - WebUI.click(newButton) -}*/ - -//GlobalVariable.G_manuscriptID = '1231234' +New = findTestObject("NewManuscript/journalfFieldSelection/New") +WebUI.click(New) journal = findTestObject('NewManuscript/journalfFieldSelection/Journal') WebUI.click(journal) @@ -61,17 +46,13 @@ WebUI.click(journal) hindawiFaraday = findTestObject('NewManuscript/journalfFieldSelection/HindawiFaraday') WebUI.click(hindawiFaraday) - issue = findTestObject('NewManuscript/journalfFieldSelection/Issue') - WebUI.click(issue) regularIssues = findTestObject('NewManuscript/journalfFieldSelection/RegularIssues') - WebUI.click(regularIssues) nextButton = findTestObject('NewManuscript/journalfFieldSelection/Next') - WebUI.click(nextButton) hasEmail = findTestObject('NewManuscript/preSubmissionChecklist/hasEmail') @@ -97,72 +78,59 @@ WebUI.click(Next) manuscriptTitle = findTestObject('NewManuscript/manuscriptAuthorsDetails/manuscriptTitle') WebUI.click(manuscriptTitle) - WebUI.sendKeys(manuscriptTitle, 'A new random title') manuscriptType = findTestObject('NewManuscript/manuscriptAuthorsDetails/manuscriptType') WebUI.click(manuscriptType) -research = findTestObject('NewManuscript/manuscriptAuthorsDetails/review') - +research = findTestObject('NewManuscript/manuscriptAuthorsDetails/Research') WebUI.click(research) abstractField = findTestObject('NewManuscript/manuscriptAuthorsDetails/abstractField') - WebUI.click(abstractField) - WebUI.sendKeys(abstractField, 'A new random abstract text') addAuthor = findTestObject('NewManuscript/manuscriptAuthorsDetails/addAuthor') - WebUI.click(addAuthor) firstName = findTestObject('NewManuscript/manuscriptAuthorsDetails/firstName') - WebUI.setText(firstName, 'Vlad') lastName = findTestObject('NewManuscript/manuscriptAuthorsDetails/lastName') - WebUI.setText(lastName, 'Stegaru') email = findTestObject('NewManuscript/manuscriptAuthorsDetails/email') - WebUI.setText(email, 'vlad.stegaru+newuser1@thinslices.com') affiliation = findTestObject('NewManuscript/manuscriptAuthorsDetails/affiliation') - WebUI.setText(affiliation, 'University') country = findTestObject('NewManuscript/manuscriptAuthorsDetails/country') - WebUI.click(country) -Canada = findTestObject('NewManuscript/manuscriptAuthorsDetails/countryOption') - -WebUI.click(Canada) +countryOption = findTestObject('NewManuscript/manuscriptAuthorsDetails/countryOption') +WebUI.click(countryOption) SaveButton = findTestObject('NewManuscript/manuscriptAuthorsDetails/Save') - WebUI.click(SaveButton) -noButton = findTestObject('NewManuscript/manuscriptAuthorsDetails/no') +submittingAuthor = findTestObject("NewManuscript/manuscriptAuthorsDetails/submittingAuthor") +WebUI.waitForElementPresent(submittingAuthor, 10) +noButton = findTestObject('NewManuscript/manuscriptAuthorsDetails/no') WebUI.click(noButton) NextButton = findTestObject('NewManuscript/manuscriptAuthorsDetails/Next') - WebUI.click(NextButton) -//attachFile = findTestObject('NewManuscript/manuscriptFilesUpload/attachManuscript') +attachFile = findTestObject('NewManuscript/manuscriptFilesUpload/attachManuscript') -//WebUI.uploadFile(attachFile, '/Users/vladstegaru/Documents/Hindawi/attachements/document.pdf') +WebUI.uploadFile(attachFile, '/Users/vladstegaru/Documents/Hindawi/attachements/document.pdf') submitManuscript = findTestObject('NewManuscript/manuscriptFilesUpload/submitManuscript') - WebUI.click(submitManuscript) goToDashboard = findTestObject('Resume/goToDashboard') - WebUI.click(goToDashboard) WebUI.closeBrowser() diff --git a/automation/Scripts/Add a new user/Edit new user/Script1521147575383.groovy b/automation/Scripts/Edit a new user/Edit new user/Script1521147575383.groovy similarity index 75% rename from automation/Scripts/Add a new user/Edit new user/Script1521147575383.groovy rename to automation/Scripts/Edit a new user/Edit new user/Script1521147575383.groovy index 8302d316f66b7adc2198ca18262cba4998b48940..2842d6e3a3cb548751895cf66c724e52f8b56c08 100644 --- a/automation/Scripts/Add a new user/Edit new user/Script1521147575383.groovy +++ b/automation/Scripts/Edit a new user/Edit new user/Script1521147575383.groovy @@ -22,15 +22,15 @@ import internal.GlobalVariable as GlobalVariable WebUI.openBrowser(null) WebUI.navigateToUrl('https://xpub-faraday.now.sh') -username = findTestObject("NewUser/username") +username = findTestObject("SignIn/username") WebUI.click(username) WebUI.setText(username, 'admin') -password = findTestObject("NewUser/password") +password = findTestObject("SignIn/password") WebUI.click(password) WebUI.setText(password, 'admin123') -login = findTestObject("NewUser/login") +login = findTestObject("SignIn/login") WebUI.click(login) admin = findTestObject("NewUser/adminButton") @@ -40,38 +40,37 @@ adminDashboard = findTestObject("NewUser/adminDashboard") WebUI.click(adminDashboard) users = findTestObject("NewUser/users") -WebUI.waitForElementVisible(users, 2) WebUI.click(users) -editUserVlad = findTestObject("NuewUser/td_vlad.stegarunewuserthinslic") -WebUI.mouseOver(editUserVlad) -WebUI.waitForElementVisible(edit, 2) +admin = findTestObject("EditUser/td_admin") +WebUI.mouseOver(admin) +WebUI.waitForElementVisible(admin, 2) -edit = findTestObject("NewUSer/a_Edit") +edit = findTestObject("EditUser/a_Edit") WebUI.click(edit) -firstName = findTestObject("NewUser/firstName") +firstName = findTestObject("EditUser/firstName") WebUI.click(firstName) WebUI.setText(firstName, 'John') -lastName = findTestObject("NewUser/lastName") +lastName = findTestObject("EditUser/lastName") WebUI.click(lastName) WebUI.setText(lastName, 'Smith') -affiliation = findTestObject("NewUser/affiliation") +affiliation = findTestObject("EditUser/affiliation") WebUI.click(affiliation) WebUI.setText(affiliation, 'University') -title = findTestObject("NewUser/titleDropDown") +title = findTestObject("EditUser/titleDropDown") WebUI.click(title) -dr = findTestObject("NewUser/dr") -WebUI.click(dr) +professor = findTestObject("EditUser/Professor") +WebUI.click(professor) -editorInChief = findTestObject("NewUser/editorInChief") +editorInChief = findTestObject("EditUser/editorInChief") WebUI.click(editorInChief) -save = findTestObject("NewUser/save") +save = findTestObject("EditUser/save") WebUI.click(save) diff --git a/automation/Scripts/Filter Manuscripts/Filter the manuscripts/Script1521714001455.groovy b/automation/Scripts/Filter Manuscripts/Filter the manuscripts/Script1521714001455.groovy index 63b91bc13e28ce472c79091c4e3efd3ea7eaa6b4..2f5c694dfc6ae7996b266d456db55ce252780893 100644 --- a/automation/Scripts/Filter Manuscripts/Filter the manuscripts/Script1521714001455.groovy +++ b/automation/Scripts/Filter Manuscripts/Filter the manuscripts/Script1521714001455.groovy @@ -23,19 +23,19 @@ WebUI.openBrowser(null) WebUI.navigateToUrl('xpub-faraday.now.sh') -username = findTestObject('SignIn/usernameField') +username = findTestObject('SignIn/username') WebUI.click(username) WebUI.setText(username, 'admin') -password = findTestObject('SignIn/passwordField') +password = findTestObject('SignIn/password') WebUI.click(password) WebUI.setText(password, 'admin123') -loginButton = findTestObject('SignIn/LoginButton') +loginButton = findTestObject('SignIn/login') WebUI.click(loginButton) diff --git a/automation/Scripts/Resume Manuscript/Resume submission Redirect/Script1520866853834.groovy b/automation/Scripts/Resume Manuscript/Resume submission Redirect/Script1520866853834.groovy index 323746b8a7e5d7e3ac0dba0db12f7b2dd8fdc29c..d2563a44fada4bce7395c5f9d28ee77ef942dac3 100644 --- a/automation/Scripts/Resume Manuscript/Resume submission Redirect/Script1520866853834.groovy +++ b/automation/Scripts/Resume Manuscript/Resume submission Redirect/Script1520866853834.groovy @@ -25,20 +25,19 @@ WebUI.openBrowser(null) WebUI.navigateToUrl('https://xpub-faraday.now.sh') -username = findTestObject('SignIn/usernameField') +username = findTestObject('SignIn/username') WebUI.click(username) WebUI.setText(username, 'admin') -password = findTestObject('SignIn/passwordField') +password = findTestObject('SignIn/password') WebUI.click(password) WebUI.setText(password, 'admin123') -loginButton = findTestObject('SignIn/LoginButton') +loginButton = findTestObject('SignIn/login') WebUI.click(loginButton) resumeSubmission = findTestObject('Resume/resumeSubmission') WebUI.click(resumeSubmission) -WebUI.waitForPageLoad(2, FailureHandling.STOP_ON_FAILURE) cancel = findTestObject("NewManuscript/journalAndFieldSelection/Cancel") WebUI.waitForElementVisible(cancel, 2) diff --git a/automation/Scripts/Resume submission Redirect/Script1520866853834.groovy b/automation/Scripts/Resume submission Redirect/Script1520866853834.groovy deleted file mode 100644 index 1f5ad7619f9f37b7e25bc210c013f3d43e6042be..0000000000000000000000000000000000000000 --- a/automation/Scripts/Resume submission Redirect/Script1520866853834.groovy +++ /dev/null @@ -1,46 +0,0 @@ -import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint -import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase -import static com.kms.katalon.core.testdata.TestDataFactory.findTestData -import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject -import java.util.concurrent.CancellationException as CancellationException -import org.junit.After as After -import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint -import com.kms.katalon.core.checkpoint.CheckpointFactory as CheckpointFactory -import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as MobileBuiltInKeywords -import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile -import com.kms.katalon.core.model.FailureHandling as FailureHandling -import com.kms.katalon.core.testcase.TestCase as TestCase -import com.kms.katalon.core.testcase.TestCaseFactory as TestCaseFactory -import com.kms.katalon.core.testdata.TestData as TestData -import com.kms.katalon.core.testdata.TestDataFactory as TestDataFactory -import com.kms.katalon.core.testobject.ObjectRepository as ObjectRepository -import com.kms.katalon.core.testobject.TestObject as TestObject -import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WSBuiltInKeywords -import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS -import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUiBuiltInKeywords -import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI -import internal.GlobalVariable as GlobalVariable - -WebUI.openBrowser(null) - -WebUI.navigateToUrl('http://localhost:3000') - -username = findTestObject('SignIn/usernameField') -WebUI.click(username) -WebUI.setText(username, 'vlad') - -password = findTestObject('SignIn/passwordField') -WebUI.click(password) -WebUI.setText(password, '123123123') - -loginButton = findTestObject('SignIn/LoginButton') -WebUI.click(loginButton) - -New = findTestObject("NewManuscript/journalFieldSelection/New") -WebUI.click(New) - -resumeSubmission = findTestObject('Resume/resumeSubmission') -WebUI.click(resumeSubmission) - -cancel = findTestObject("NewManuscript/journalFieldSelection/Cancel") -WebUI.click(cancel) diff --git a/automation/Scripts/Sign In/Sign In flow/Script1520414607328.groovy b/automation/Scripts/Sign In/Sign In flow/Script1520414607328.groovy index 4d3266de828af326f19e49465266ee8909a58b6c..e07efc4c3293d1ad479c102e4db62da6a46a872e 100644 --- a/automation/Scripts/Sign In/Sign In flow/Script1520414607328.groovy +++ b/automation/Scripts/Sign In/Sign In flow/Script1520414607328.groovy @@ -29,15 +29,15 @@ WebUI.openBrowser(null) WebUI.navigateToUrl('http://localhost:3000') -WebUI.click(findTestObject('SignIn/usernameField')) +WebUI.click(findTestObject('SignIn/username')) -WebUI.setText(findTestObject('SignIn/usernameField'), "vlad") +WebUI.setText(findTestObject('SignIn/username'), "vlad") -WebUI.click(findTestObject('SignIn/passwordField')) +WebUI.click(findTestObject('SignIn/password')) -WebUI.setText(findTestObject('SignIn/passwordField'), "123123123") +WebUI.setText(findTestObject('SignIn/password'), "123123123") -WebUI.click(findTestObject('SignIn/LoginButton')) +WebUI.click(findTestObject('SignIn/login')) diff --git a/automation/Test Cases/Add a new user/Edit new user.tc b/automation/Test Cases/Edit a new user/Edit new user.tc similarity index 100% rename from automation/Test Cases/Add a new user/Edit new user.tc rename to automation/Test Cases/Edit a new user/Edit new user.tc diff --git a/automation/Test Cases/Resume submission Redirect.tc b/automation/Test Cases/Resume submission Redirect.tc deleted file mode 100644 index 8b49244b55d1c8d685de8560527d803168b738cd..0000000000000000000000000000000000000000 --- a/automation/Test Cases/Resume submission Redirect.tc +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<TestCaseEntity> - <description></description> - <name>Resume submission Redirect</name> - <tag></tag> - <comment></comment> - <testCaseGuid>b1e8c453-0030-4896-9e4a-770f07525309</testCaseGuid> -</TestCaseEntity> diff --git a/automation/Test Suites/firstTS.ts b/automation/Test Suites/firstTS.ts index b314efc6ddcff46327ceedf88aa602ae427caac2..854f4745982d3a31db73280109caeaed231c94d9 100644 --- a/automation/Test Suites/firstTS.ts +++ b/automation/Test Suites/firstTS.ts @@ -10,22 +10,4 @@ <pageLoadTimeoutDefault>true</pageLoadTimeoutDefault> <rerunFailedTestCasesOnly>false</rerunFailedTestCasesOnly> <testSuiteGuid>f13b4374-3272-420a-8e20-e8751334e62d</testSuiteGuid> - <testCaseLink> - <guid>03b92392-1421-4db8-b800-d82f1d688a71</guid> - <isReuseDriver>false</isReuseDriver> - <isRun>true</isRun> - <testCaseId>Test Cases/Add new manuscript/Add a new manuscript</testCaseId> - <variableLink> - <testDataLinkId></testDataLinkId> - <type>SCRIPT_VARIABLE</type> - <value>null</value> - <variableId>30a84231-84ba-44cb-9eec-26ad7d97acd5</variableId> - </variableLink> - </testCaseLink> - <testCaseLink> - <guid>99bf045f-3219-4350-8823-3217d4676eb9</guid> - <isReuseDriver>false</isReuseDriver> - <isRun>true</isRun> - <testCaseId>Test Cases/Resume submission Redirect</testCaseId> - </testCaseLink> </TestSuiteEntity> diff --git a/packages/component-invite/src/controllers/assignCollectionRole.js b/packages/component-invite/src/controllers/assignCollectionRole.js index e810e941147c908584f9b5ec5daaf72aa9c2ad5a..a1489330d600d046fbd9feb747749ce0b755c7d0 100644 --- a/packages/component-invite/src/controllers/assignCollectionRole.js +++ b/packages/component-invite/src/controllers/assignCollectionRole.js @@ -18,13 +18,13 @@ module.exports = async ( url, resend, ) => { - if (reqUser.admin) { - logger.error(`admin tried to invite a ${role} to a collection`) + // if (reqUser.admin) { + // logger.error(`admin tried to invite a ${role} to a collection`) - return res.status(403).json({ - error: `admin cannot invite an ${role} to a collection`, - }) - } + // return res.status(403).json({ + // error: `admin cannot invite an ${role} to a collection`, + // }) + // } if (!configRoles.collection.includes(role)) { logger.error(`invitation has been attempted with invalid role: ${role}`) diff --git a/packages/component-modal/src/components/ConfirmationModal.js b/packages/component-modal/src/components/ConfirmationModal.js index ddc1d30f39d44b94f2a287690cc768e33f804241..7d1b6664396f7396d6ecfa8cb17d19464f743660 100644 --- a/packages/component-modal/src/components/ConfirmationModal.js +++ b/packages/component-modal/src/components/ConfirmationModal.js @@ -1,5 +1,5 @@ import React from 'react' -import { Icon, Button } from '@pubsweet/ui' +import { Icon, Button, th } from '@pubsweet/ui' import styled, { css, withTheme } from 'styled-components' const ConfirmationModal = ({ @@ -11,6 +11,7 @@ const ConfirmationModal = ({ cancelText = 'Cancel', hideModal, theme, + modalError, }) => ( <Root> <CloseIcon data-test="icon-modal-hide" onClick={hideModal}> @@ -19,13 +20,18 @@ const ConfirmationModal = ({ {title && <Title dangerouslySetInnerHTML={{ __html: title }} />} {subtitle && <Subtitle dangerouslySetInnerHTML={{ __html: subtitle }} />} {content && <Content dangerouslySetInnerHTML={{ __html: content }} />} + + {modalError && <ErrorMessage>{modalError}</ErrorMessage>} + <ButtonsContainer> <Button data-test="button-modal-hide" onClick={hideModal}> {cancelText} </Button> - <Button data-test="button-modal-confirm" onClick={onConfirm} primary> - {confirmText} - </Button> + {onConfirm && ( + <Button data-test="button-modal-confirm" onClick={onConfirm} primary> + {confirmText} + </Button> + )} </ButtonsContainer> </Root> ) @@ -34,51 +40,59 @@ export default withTheme(ConfirmationModal) // #region styled-components const defaultText = css` - color: ${({ theme }) => theme.colorText}; - font-family: ${({ theme }) => theme.fontReading}; - font-size: ${({ theme }) => theme.fontSizeBaseSmall}; + color: ${th('colorText')}; + font-family: ${th('fontReading')}; + font-size: ${th('fontSizeBaseSmall')}; ` const Root = styled.div` - background-color: ${({ theme }) => theme.backgroundColor}; - padding: 50px 32px 32px 32px; - border: ${({ theme }) => theme.borderDefault}; + background-color: ${th('backgroundColor')}; + border: ${th('borderDefault')}; + display: flex; + flex-direction: column; + justify-content: space-between; + max-height: calc(${th('gridUnit')} * 20); + padding: calc(${th('gridUnit')} * 2); position: relative; - width: 600px; - max-height: 500px; overflow-y: scroll; + width: calc(${th('gridUnit')} * 25); ` const Title = styled.div` ${defaultText}; - font-size: ${({ theme }) => theme.fontSizeBase}; + font-size: ${th('fontSizeHeading5')}; + margin-bottom: ${th('gridUnit')}; text-align: center; - margin-bottom: 20px; ` const Subtitle = styled.div` ${defaultText}; - font-weight: bold; - line-height: 1.57; - margin-bottom: 15px; + margin-bottom: calc(${th('subGridUnit')} * 6); text-align: center; ` const Content = styled.div` ${defaultText}; - line-height: 1.57; - margin-top: 10px; + margin-top: calc(${th('subGridUnit')} * 2); text-align: left; ` const ButtonsContainer = styled.div` display: flex; justify-content: space-evenly; - margin: 30px auto 0; + margin: ${th('gridUnit')} auto 0; + width: 100%; ` const CloseIcon = styled.div` cursor: pointer; position: absolute; - top: 5px; - right: 5px; + top: ${th('subGridUnit')}; + right: ${th('subGridUnit')}; ` + +const ErrorMessage = styled.div` + color: ${th('colorError')}; + margin: ${th('subGridUnit')}; + text-align: center; +` + // #endregion diff --git a/packages/component-modal/src/components/Modal.js b/packages/component-modal/src/components/Modal.js index 4015782fef9d60d7ecde1e2d19efeb83628036d5..b16774202a19629f580e8fe050200b9c1fa2ba8c 100644 --- a/packages/component-modal/src/components/Modal.js +++ b/packages/component-modal/src/components/Modal.js @@ -40,5 +40,5 @@ const ModalRoot = styled.div` justify-content: center; background-color: ${({ overlayColor }) => overlayColor || 'rgba(0, 0, 0, 0.8)'}; - /* z-index: ${({ theme }) => theme.modalIndex}; */ + z-index: ${({ theme }) => theme.modalIndex}; ` diff --git a/packages/component-modal/src/components/SuccessModal.js b/packages/component-modal/src/components/SuccessModal.js new file mode 100644 index 0000000000000000000000000000000000000000..676ba603e6cd5312967d6d6a9efa548fb85c1dc4 --- /dev/null +++ b/packages/component-modal/src/components/SuccessModal.js @@ -0,0 +1,51 @@ +import React from 'react' +import { Button, th } from '@pubsweet/ui' +import styled, { css, withTheme } from 'styled-components' + +const SuccessModal = ({ title, confirmText = 'OK', hideModal, theme }) => ( + <Root> + {title && <Title dangerouslySetInnerHTML={{ __html: title }} />} + <ButtonsContainer> + <Button data-test="button-modal-confirm" onClick={hideModal} primary> + {confirmText} + </Button> + </ButtonsContainer> + </Root> +) + +export default withTheme(SuccessModal) + +// #region styled-components +const defaultText = css` + color: ${th('colorText')}; + font-family: ${th('fontReading')}; + font-size: ${th('fontSizeBaseSmall')}; +` + +const Root = styled.div` + background-color: ${th('backgroundColor')}; + border: ${th('borderDefault')}; + display: flex; + flex-direction: column; + justify-content: space-between; + max-height: calc(${th('gridUnit')} * 20); + padding: calc(${th('gridUnit')} * 2); + position: relative; + overflow-y: scroll; + width: calc(${th('gridUnit')} * 25); +` + +const Title = styled.div` + ${defaultText}; + font-size: ${th('fontSizeHeading5')}; + margin-bottom: ${th('gridUnit')}; + text-align: center; +` + +const ButtonsContainer = styled.div` + display: flex; + justify-content: space-evenly; + margin: ${th('gridUnit')} auto 0; + width: 100%; +` +// #endregion diff --git a/packages/component-modal/src/components/index.js b/packages/component-modal/src/components/index.js index 22f1e90fca99f0f6b8c1d66c3d91272730d9078d..724e8d8878f79f7754077b39dda7a1105632eebb 100644 --- a/packages/component-modal/src/components/index.js +++ b/packages/component-modal/src/components/index.js @@ -1,2 +1,3 @@ export { default as withModal } from './withModal' +export { default as SuccessModal } from './SuccessModal' export { default as ConfirmationModal } from './ConfirmationModal' diff --git a/packages/component-modal/src/components/withModal.js b/packages/component-modal/src/components/withModal.js index 1d5c786c7b6026264442f30a9ab52ecb59c0a7fa..84a7b51fd1a957730e963cde62d78db750082b87 100644 --- a/packages/component-modal/src/components/withModal.js +++ b/packages/component-modal/src/components/withModal.js @@ -3,16 +3,18 @@ import { omit } from 'lodash' import { connect } from 'react-redux' import Modal from './Modal' -import { showModal, hideModal } from '../redux/modal' +import { showModal, hideModal, setModalError } from '../redux/modal' const mapState = state => ({ modalsVisibility: omit(state.modal, 'props'), modalProps: state.modal.props, + modalError: state.modal.error, }) const mapDispatch = modalKey => (dispatch, propss) => ({ hideModal: () => dispatch(hideModal()), showModal: (modalProps = {}) => dispatch(showModal(modalKey, modalProps)), + setModalError: errorMessage => dispatch(setModalError(errorMessage)), }) const withModal = ({ @@ -21,13 +23,14 @@ const withModal = ({ overlayColor, }) => WrappedComponent => connect(mapState, mapDispatch(modalKey))( - ({ modalsVisibility, modalProps, hideModal, ...rest }) => ( + ({ modalsVisibility, modalProps, modalError, hideModal, ...rest }) => ( <React.Fragment> {modalsVisibility[modalKey] && ( <Modal {...modalProps} component={Component} hideModal={hideModal} + modalError={modalError} overlayColor={overlayColor} /> )} diff --git a/packages/component-modal/src/redux/modal.js b/packages/component-modal/src/redux/modal.js index cba9f707d60c3001c123abad56ced39270e1821e..06d5702bfafc89ef6732a95773a3504490eac45a 100644 --- a/packages/component-modal/src/redux/modal.js +++ b/packages/component-modal/src/redux/modal.js @@ -1,8 +1,10 @@ const initialState = { + error: null, props: {}, } const SHOW_MODAL = 'modal/SHOW_MODAL' +const SET_MODAL_ERROR = 'modal/SET_MODAL_ERROR' const HIDE_MODAL = 'modal/HIDE_MODAL' export const showModal = (modalKey, props = {}) => ({ @@ -13,6 +15,13 @@ export const showModal = (modalKey, props = {}) => ({ }, }) +export const setModalError = error => ({ + type: SET_MODAL_ERROR, + payload: { + error, + }, +}) + export const hideModal = () => ({ type: HIDE_MODAL, }) @@ -24,8 +33,14 @@ export default (state = initialState, action = {}) => { case SHOW_MODAL: return { [action.payload.modalKey]: true, + error: null, props: action.payload.props, } + case SET_MODAL_ERROR: + return { + ...state, + error: action.payload.error, + } case HIDE_MODAL: return initialState default: diff --git a/packages/components-faraday/src/components/Dashboard/AssignEditor.js b/packages/components-faraday/src/components/Dashboard/AssignEditor.js deleted file mode 100644 index 4fca2fe52927497f5f0d595dcc4c7a5ea37b77c0..0000000000000000000000000000000000000000 --- a/packages/components-faraday/src/components/Dashboard/AssignEditor.js +++ /dev/null @@ -1,42 +0,0 @@ -import React from 'react' -import styled, { css } from 'styled-components' -import { Button, th } from '@pubsweet/ui' -import { compose, withHandlers } from 'recompose' -import { withModal } from 'pubsweet-component-modal/src/components' - -import HEModal from './AssignHEModal' - -const AssignEditor = ({ assign }) => ( - <ActionButtons onClick={assign}>ASSIGN</ActionButtons> -) - -export default compose( - withModal({ - modalKey: 'assignHEmodal', - modalComponent: HEModal, - }), - withHandlers({ - assign: ({ showModal, collectionId }) => () => { - showModal({ - collectionId, - }) - }, - }), -)(AssignEditor) - -// #region styled-components -const defaultText = css` - color: ${th('colorText')}; - font-family: ${th('fontReading')}; - font-size: ${th('fontSizeBaseSmall')}; -` - -const ActionButtons = styled(Button)` - ${defaultText}; - align-items: center; - background-color: ${th('colorPrimary')}; - color: ${th('colorTextReverse')}; - text-align: center; - height: calc(${th('subGridUnit')}*5); -` -// #endregion diff --git a/packages/components-faraday/src/components/Dashboard/AssignHEModal.js b/packages/components-faraday/src/components/Dashboard/AssignHEModal.js index 86e6d1438c6334a18508077cd7bbcf56b1ff03f9..ef88615497283f28f013fce03dbf80d3233f5f28 100644 --- a/packages/components-faraday/src/components/Dashboard/AssignHEModal.js +++ b/packages/components-faraday/src/components/Dashboard/AssignHEModal.js @@ -1,10 +1,11 @@ /* eslint react/prefer-stateless-function: 0 */ import React from 'react' -import { th } from '@pubsweet/ui' +import { get } from 'lodash' import { compose } from 'recompose' import { connect } from 'react-redux' -import styled from 'styled-components' +import { th, Icon } from '@pubsweet/ui' +import styled, { withTheme } from 'styled-components' import { handlingEditors, assignHandlingEditor } from '../../redux/editors' @@ -27,22 +28,46 @@ class AssignHEModal extends React.Component { } assignEditor = email => () => { - const { assignHandlingEditor, collectionId, hideModal } = this.props - assignHandlingEditor(email, collectionId).then(hideModal) + const { + assignHandlingEditor, + collectionId, + showModal, + hideModal, + setModalError, + } = this.props + assignHandlingEditor(email, collectionId).then( + () => { + hideModal() + showModal({ + type: 'confirmation', + title: 'Assignation Sent', + cancelText: 'OK', + }) + }, + e => { + setModalError( + get(JSON.parse(e.response), 'error') || 'Oops! Something went wrong!', + ) + }, + ) } render() { const { searchInput } = this.state - const { editors } = this.props + const { editors, hideModal, theme } = this.props const filteredEditors = this.filterEditors(editors) return ( <RootModal> - <button onClick={this.props.hideModal}>CLOSE</button> + <CloseIcon data-test="icon-modal-hide" onClick={hideModal}> + <Icon color={theme.colorPrimary}>x</Icon> + </CloseIcon> <ModalTitle>Assign Handling Editor</ModalTitle> <ModalHeader> <span>HANDLING EDITORS</span> <SearchInput + data-test="he-search" onChange={this.changeInput} + placeholder="Search by name or email" type="text" value={searchInput} /> @@ -58,7 +83,10 @@ class AssignHEModal extends React.Component { <span>{`${firstName} ${lastName}`}</span> <span>{email}</span> </EditorDetails> - <AssignButton onClick={this.assignEditor(email)}> + <AssignButton + data-test={`assign-${email}`} + onClick={this.assignEditor(email)} + > ASSIGN </AssignButton> </SuggestedEditor> @@ -77,9 +105,17 @@ export default compose( }), { assignHandlingEditor }, ), + withTheme, )(AssignHEModal) // #region styled-components +const CloseIcon = styled.div` + cursor: pointer; + position: absolute; + top: 5px; + right: 5px; +` + const EditorDetails = styled.div` display: flex; flex-direction: column; @@ -100,13 +136,16 @@ const SuggestedEditor = styled.div` const AssignButton = styled.button` align-items: center; - color: ${th('colorTextReverse')}; background-color: ${th('colorPrimary')}; + cursor: pointer; + color: ${th('colorTextReverse')}; display: flex; justify-content: center; + font-size: ${th('fontSizeBaseSmall')}; + font-family: ${th('fontReading')}; height: ${th('gridUnit')}; - width: calc(${th('gridUnit')} * 4); opacity: 0; + width: calc(${th('gridUnit')} * 4); ${SuggestedEditor}:hover & { opacity: 1; @@ -121,6 +160,7 @@ const RootModal = styled.div` justify-content: flex-start; height: calc(${th('gridUnit')} * 18); padding: calc(${th('subGridUnit')} * 8) calc(${th('subGridUnit')} * 6); + position: relative; width: calc(${th('gridUnit')} * 24); ` @@ -139,6 +179,7 @@ const ModalHeader = styled.div` & span { color: ${th('colorPrimary')}; font-size: ${th('fontSizeBase')}; + font-family: ${th('fontReading')}; margin-bottom: ${th('subGridUnit')}; } ` @@ -147,6 +188,11 @@ const SearchInput = styled.input` border: 4px solid gray; height: calc(${th('subGridUnit')} * 5); padding: ${th('subGridUnit')}; + + &:focus, + &:active { + outline: none; + } ` const ScrollContainer = styled.div` diff --git a/packages/components-faraday/src/components/Dashboard/DashboardCard.js b/packages/components-faraday/src/components/Dashboard/DashboardCard.js index 9401acd55ba87aac3e577ecc444865d973eb433d..2bcd182ffbf77fa27368ba7dce03e5228b65bd77 100644 --- a/packages/components-faraday/src/components/Dashboard/DashboardCard.js +++ b/packages/components-faraday/src/components/Dashboard/DashboardCard.js @@ -1,9 +1,13 @@ import React from 'react' import { get } from 'lodash' import PropTypes from 'prop-types' -import { compose, getContext } from 'recompose' import { Button, Icon, th } from '@pubsweet/ui' import styled, { css, withTheme } from 'styled-components' +import { compose, getContext, withHandlers } from 'recompose' +import { + withModal, + ConfirmationModal, +} from 'pubsweet-component-modal/src/components' import ZipFiles from './ZipFiles' import { parseVersion, parseJournalIssue } from './utils' @@ -16,7 +20,7 @@ const DashboardCard = ({ version, showAbstractModal, journal, - cancelSubmission, + showConfirmationModal, theme, ...rest }) => { @@ -89,9 +93,9 @@ const DashboardCard = ({ ) : ( <Details data-test="button-cancel-submission" - onClick={cancelSubmission} + onClick={showConfirmationModal} > - Cancel submission + Delete </Details> )} </RightDetails> @@ -139,9 +143,36 @@ const DashboardCard = ({ ) : null } -export default compose(getContext({ journal: PropTypes.object }), withTheme)( - DashboardCard, -) +export default compose( + getContext({ journal: PropTypes.object }), + withTheme, + withModal({ + modalKey: 'cancelManuscript', + modalComponent: ConfirmationModal, + }), + withHandlers({ + showConfirmationModal: ({ + deleteProject, + showModal, + hideModal, + setModalError, + project, + }) => () => { + showModal({ + title: 'Are you sure you want to delete this submission?', + confirmText: 'Delete', + onConfirm: () => { + deleteProject(project).then(hideModal, e => { + setModalError( + get(JSON.parse(e.response), 'error') || + 'Oops! Something went wrong!', + ) + }) + }, + }) + }, + }), +)(DashboardCard) // #region styled-components const defaultText = css` diff --git a/packages/components-faraday/src/components/Dashboard/HandlingEditorActions.js b/packages/components-faraday/src/components/Dashboard/HandlingEditorActions.js index c9a60e77aee3acdcdf1bd9ebbd390a808121c61b..5443f219f601fcda26aa9dddea4652d84daa42d7 100644 --- a/packages/components-faraday/src/components/Dashboard/HandlingEditorActions.js +++ b/packages/components-faraday/src/components/Dashboard/HandlingEditorActions.js @@ -1,11 +1,26 @@ import React from 'react' import { get, head } from 'lodash' -import { Icon, th } from '@pubsweet/ui' -import styled, { css, withTheme } from 'styled-components' +import { connect } from 'react-redux' +import { Icon, Button, th } from '@pubsweet/ui' import { compose, withHandlers } from 'recompose' -import AssignEditor from './AssignEditor' +import styled, { css, withTheme } from 'styled-components' +import { + withModal, + ConfirmationModal, + SuccessModal, +} from 'pubsweet-component-modal/src/components' + +import { revokeHandlingEditor, assignHandlingEditor } from '../../redux/editors' -const HandlingEditorActions = ({ project, theme, getHandlingEditor }) => { +import HEModal from './AssignHEModal' + +const HandlingEditorActions = ({ + project, + theme, + getHandlingEditor, + showConfirmModal, + showHEModal, +}) => { const handlingEditor = getHandlingEditor() return ( <Root> @@ -15,21 +30,46 @@ const HandlingEditorActions = ({ project, theme, getHandlingEditor }) => { <HEName>{get(handlingEditor, 'name')}</HEName> {!handlingEditor.hasAnswer && ( <HEActions> - <Icon color={theme.colorPrimary}>refresh-cw</Icon> - <Icon color={theme.colorPrimary}>x-circle</Icon> + <div onClick={showConfirmModal('resend')}> + <Icon color={theme.colorPrimary}>refresh-cw</Icon> + </div> + <div onClick={showConfirmModal('cancel')}> + <Icon color={theme.colorPrimary}>x-circle</Icon> + </div> </HEActions> )} </HEActions> ) : ( - <AssignEditor collectionId={project.id} /> + <AssignButton onClick={showHEModal}>Assign</AssignButton> )} </HEActions> </Root> ) } +const CardModal = ({ type, ...rest }) => { + switch (type) { + case 'confirmation': + return <ConfirmationModal {...rest} /> + case 'success': + return <SuccessModal {...rest} /> + case 'he-modal': + default: + return <HEModal {...rest} /> + } +} + +const handleError = fn => e => { + fn(get(JSON.parse(e.response), 'error') || 'Oops! Something went wrong!') +} + export default compose( + connect(null, { revokeHandlingEditor, assignHandlingEditor }), withTheme, + withModal({ + modalKey: 'confirmHE', + modalComponent: CardModal, + }), withHandlers({ getHandlingEditor: ({ project }) => () => { const assignedEditors = get(project, 'assignedPeople') @@ -44,6 +84,56 @@ export default compose( return null }, }), + withHandlers({ + showConfirmModal: ({ + showModal, + project, + revokeHandlingEditor, + assignHandlingEditor, + getHandlingEditor, + hideModal, + setModalError, + }) => actionType => { + const editor = getHandlingEditor() + const resendConfig = { + title: 'Resend Invitation?', + subtitle: '', + confirmText: 'Resend', + onConfirm: () => + assignHandlingEditor(get(editor, 'email'), project.id, true).then( + () => { + hideModal() + showModal({ + type: 'success', + title: 'Invite resent', + }) + }, + handleError(setModalError), + ), + } + const revokeConfig = { + title: 'Revoke Handling Editor Assignation?', + subtitle: `Clicking 'Revoke' will allow you to invite a different person.`, + confirmText: 'Revoke invite', + onConfirm: () => + revokeHandlingEditor(get(editor, 'id'), project.id).then(() => { + hideModal() + showModal({ + type: 'success', + title: 'Handling Editor Assignation Revoked', + }) + }, handleError(setModalError)), + } + + return () => { + const cfg = actionType === 'resend' ? resendConfig : revokeConfig + showModal({ ...cfg, type: 'confirmation' }) + } + }, + showHEModal: ({ showModal, project }) => () => { + showModal({ type: 'he-modal', collectionId: project.id, showModal }) + }, + }), )(HandlingEditorActions) // #region styled-components @@ -75,4 +165,13 @@ const HEActions = styled.div` } } ` + +const AssignButton = styled(Button)` + ${defaultText}; + align-items: center; + background-color: ${th('colorPrimary')}; + color: ${th('colorTextReverse')}; + text-align: center; + height: calc(${th('subGridUnit')}*5); +` // #endregion diff --git a/packages/components-faraday/src/redux/editors.js b/packages/components-faraday/src/redux/editors.js index 77fee22d73b2f328a8e718a8a028d30b74ad3955..4203a858219f6261cb37f05a39e2109c64a7f90b 100644 --- a/packages/components-faraday/src/redux/editors.js +++ b/packages/components-faraday/src/redux/editors.js @@ -25,7 +25,7 @@ export const assignHandlingEditor = ( resend, }) -export const revokeHandlingEditor = (collectionId, userId) => dispatch => +export const revokeHandlingEditor = (userId, collectionId) => dispatch => remove(`/collections/${collectionId}/users/${userId}?role=handlingEditor`) const initialState = [] diff --git a/yarn.lock b/yarn.lock index 5f06aabe0960b5f12163e9e80553996086a8d8cf..e2cb01c74b00d0286b23cce3cfa39d7dc976c1a4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -678,27 +678,6 @@ axobject-query@^0.1.0: dependencies: ast-types-flow "0.0.7" -babel-cli@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.26.0.tgz#502ab54874d7db88ad00b887a06383ce03d002f1" - dependencies: - babel-core "^6.26.0" - babel-polyfill "^6.26.0" - babel-register "^6.26.0" - babel-runtime "^6.26.0" - commander "^2.11.0" - convert-source-map "^1.5.0" - fs-readdir-recursive "^1.0.0" - glob "^7.1.2" - lodash "^4.17.4" - output-file-sync "^1.1.2" - path-is-absolute "^1.0.1" - slash "^1.0.0" - source-map "^0.5.6" - v8flags "^2.1.1" - optionalDependencies: - chokidar "^1.6.1" - babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" @@ -1237,14 +1216,6 @@ babel-plugin-transform-strict-mode@^6.24.1: babel-runtime "^6.22.0" babel-types "^6.24.1" -babel-polyfill@^6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz#379937abc67d7895970adc621f284cd966cf2153" - dependencies: - babel-runtime "^6.26.0" - core-js "^2.5.0" - regenerator-runtime "^0.10.5" - babel-preset-env@^1.6.0: version "1.6.1" resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.6.1.tgz#a18b564cc9b9afdf4aae57ae3c1b0d99188e6f48" @@ -1855,7 +1826,7 @@ cheerio@^1.0.0-rc.2: lodash "^4.15.0" parse5 "^3.0.1" -chokidar@^1.0.1, chokidar@^1.6.1, chokidar@^1.7.0: +chokidar@^1.0.1, chokidar@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" dependencies: @@ -3854,10 +3825,6 @@ fs-extra@^4.0.1, fs-extra@^4.0.2: jsonfile "^4.0.0" universalify "^0.1.0" -fs-readdir-recursive@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27" - fs-write-stream-atomic@^1.0.8: version "1.0.10" resolved "https://registry.yarnpkg.com/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz#b47df53493ef911df75731e70a9ded0189db40c9" @@ -4098,7 +4065,7 @@ got@^6.7.1: unzip-response "^2.0.1" url-parse-lax "^1.0.0" -graceful-fs@^4.1.0, graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.4, graceful-fs@^4.1.6: +graceful-fs@^4.1.0, graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" @@ -6533,14 +6500,6 @@ osenv@^0.1.4: os-homedir "^1.0.0" os-tmpdir "^1.0.0" -output-file-sync@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/output-file-sync/-/output-file-sync-1.1.2.tgz#d0a33eefe61a205facb90092e826598d5245ce76" - dependencies: - graceful-fs "^4.1.4" - mkdirp "^0.5.1" - object-assign "^4.1.0" - p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" @@ -6860,19 +6819,6 @@ pn@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" -portal-modal@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/portal-modal/-/portal-modal-1.0.3.tgz#1fa92680c2699a8adf2e3c6f1cf21a14b41e3a08" - dependencies: - babel-cli "^6.26.0" - babel-core "^6.26.0" - babel-preset-es2015 "^6.24.1" - babel-preset-react "^6.24.1" - babel-preset-stage-2 "^6.24.1" - react "^16.2.0" - react-dom "^16.2.0" - react-redux "^5.0.6" - postcss-calc@^5.2.0: version "5.3.1" resolved "https://registry.yarnpkg.com/postcss-calc/-/postcss-calc-5.3.1.tgz#77bae7ca928ad85716e2fda42f261bf7c1d65b5e" @@ -8009,10 +7955,6 @@ regenerate@^1.2.1: version "1.3.3" resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.3.tgz#0c336d3980553d755c39b586ae3b20aa49c82b7f" -regenerator-runtime@^0.10.5: - version "0.10.5" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" - regenerator-runtime@^0.11.0, regenerator-runtime@^0.11.1: version "0.11.1" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" @@ -9473,10 +9415,6 @@ url@^0.11.0: punycode "1.3.2" querystring "0.2.0" -user-home@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190" - util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" @@ -9540,12 +9478,6 @@ uuid@^3.0.0, uuid@^3.0.1, uuid@^3.1.0, uuid@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.2.1.tgz#12c528bb9d58d0b9265d9a2f6f0fe8be17ff1f14" -v8flags@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.1.1.tgz#aab1a1fa30d45f88dd321148875ac02c0b55e5b4" - dependencies: - user-home "^1.1.1" - validate-npm-package-license@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc"