Skip to content
Snippets Groups Projects

Uc91.2

Merged adityab3 requested to merge UC91.2 into master

NOTE: this merge request depends on UC91.1

This PR contains an update to the main flow and the alternate flow for UC91, and also contains the selenium tests for both the main and alternate flows. Now, when the form is submitted, the user's MID is displayed. When they log in, they are redirected to a new landing page. If they enter an email that is already in use, they are given an error message.

The test can be run with: mvn test -Dtest=AddPreRegisterPatientActionTest mvn test -Dtest=PreRegisterPatientTest

Edited by adityab3

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • adityab3 changed the description

    changed the description

  • assigned to @elengik2

  • @adityab3 I checked out the UC91.2 branch and tried running the tests but I'm getting a build failure:

    elengik2@fa20-cs427-053:~/UC91.2/cs427fa20team22/iTrust$ mvn test -D test=AddPreRegisterPatientActionTest        [20/1879]
    WARNING: An illegal reflective access operation has occurred                                                             
    WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/gu
    ice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)     
    WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1      
    WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations                    
    WARNING: All illegal access operations will be denied in a future release                                                
    [INFO] Scanning for projects...                                                                                          
    [WARNING]                                                                                                                
    [WARNING] Some problems were encountered while building the effective model for iTrust:iTrust:war:21.0.01                
    [WARNING] 'dependencies.dependency.systemPath' for org.cewolf:cewolf:jar should not point at files within the project dir
    ectory, ${project.basedir}/WebRoot/WEB-INF/lib/cewolf-1.1.jar will be unresolvable by dependent projects @ line 376, colu
    mn 18                                                                                                                    
    [WARNING]                                                                                                                
    [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.              
    [WARNING]                                                                                                                
    [WARNING] For this reason, future Maven versions might no longer support building such malformed projects.               
    [WARNING]                                                                                                                
    [INFO]                                                                                                                   
    [INFO] ---------------------------< iTrust:iTrust >----------------------------                                          
    [INFO] Building iTrust 21.0.01
    [INFO] --------------------------------[ war ]---------------------------------
    [WARNING] The POM for milyn:sac:jar:1.3 is missing, no dependency information available
    [INFO]
    [INFO] --- jacoco-maven-plugin:0.8.6:prepare-agent (jacoco-initialize) @ iTrust ---
    [INFO] argLine set to -javaagent:/home/elengik2/.m2/repository/org/jacoco/org.jacoco.agent/0.8.6/org.jacoco.agent-0.8.6-r
    untime.jar=destfile=/home/elengik2/UC91.2/cs427fa20team22/iTrust/target/jacoco.exec
    [INFO]
    [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ iTrust ---
    [INFO] Using 'UTF-8' encoding to copy filtered resources.
    [INFO] Copying 3 resources
    [INFO]
    [INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ iTrust ---
    [INFO] Nothing to compile - all classes are up to date
    [INFO]
    [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ iTrust ---
    [INFO] Using 'UTF-8' encoding to copy filtered resources.
    [INFO] skip non existing resourceDirectory /home/elengik2/UC91.2/cs427fa20team22/iTrust/src/test/resources
    [INFO]
    [INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) @ iTrust ---
    [INFO] Changes detected - recompiling the module!
    [INFO] Compiling 504 source files to /home/elengik2/UC91.2/cs427fa20team22/iTrust/target/test-classes
    [INFO] /home/elengik2/UC91.2/cs427fa20team22/iTrust/test/edu/ncsu/csc/itrust/unit/serverutils/MockHttpSession.java: Some
    input files use or override a deprecated API.
    [INFO] /home/elengik2/UC91.2/cs427fa20team22/iTrust/test/edu/ncsu/csc/itrust/unit/serverutils/MockHttpSession.java: Recompile with -Xlint:deprecation for details.
    [INFO]
    [INFO] --- exec-maven-plugin:1.4.0:java (default) @ iTrust ---
    [INFO]
    [INFO] --- maven-surefire-plugin:2.19:test (default-test) @ iTrust ---
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time:  12.455 s
    [INFO] Finished at: 2020-11-06T15:12:49-06:00
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19:test (default-test) on project iTrust: No tests were executed!  (Set -DfailIfNoTests=false to ignore this error.) -> [Help 1]
    [ERROR]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
    Edited by elengik2
  • Author Maintainer

    It looks like there might be a typo in the command try:

    mvn test -Dtest=AddPreRegisterPatientActionTest

    without a space between the -D and the test

  • I had to run mvn package -DskipTests first in order to create the package (which is maybe why Tonia's didn't work). I got mvn test -Dtest=AddPreRegisterPatientActionTest to work with 0 errors and 0 failures, but when I ran mvn test -Dtest=PreRegisterPatientTest there were 5 errors:

    -------------------------------------------------------
     T E S T S
    -------------------------------------------------------
    Running edu.ncsu.csc.itrust.selenium.PreRegisterPatientTest
    Tests run: 5, Failures: 0, Errors: 5, Skipped: 0, Time elapsed: 27.793 sec <<< FAILURE! - in edu.ncsu.csc.itrust.selenium.PreRegisterPatientTest
    testInvalidName(edu.ncsu.csc.itrust.selenium.PreRegisterPatientTest)  Time elapsed: 13.954 sec  <<< ERROR!
    org.openqa.selenium.NoSuchElementException: 
    Unable to locate element with ID: preregister_link
    For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
    Build info: version: '2.25.0', revision: '17482', time: '2012-07-18 22:18:01'
    System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.15.7', java.version: '1.8.0_261'
    Driver info: driver.version: HtmlUnitDriver
    	at edu.ncsu.csc.itrust.selenium.PreRegisterPatientTest.goToPreRegister(PreRegisterPatientTest.java:28)
    	at edu.ncsu.csc.itrust.selenium.PreRegisterPatientTest.testInvalidName(PreRegisterPatientTest.java:77)
    
    testPreRegisterPatientSuccessRequired(edu.ncsu.csc.itrust.selenium.PreRegisterPatientTest)  Time elapsed: 3.256 sec  <<< ERROR!
    org.openqa.selenium.NoSuchElementException: 
    Unable to locate element with ID: preregister_link
    For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
    Build info: version: '2.25.0', revision: '17482', time: '2012-07-18 22:18:01'
    System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.15.7', java.version: '1.8.0_261'
    Driver info: driver.version: HtmlUnitDriver
    	at edu.ncsu.csc.itrust.selenium.PreRegisterPatientTest.goToPreRegister(PreRegisterPatientTest.java:28)
    	at edu.ncsu.csc.itrust.selenium.PreRegisterPatientTest.testPreRegisterPatientSuccessRequired(PreRegisterPatientTest.java:37)
    
    testMissingElements(edu.ncsu.csc.itrust.selenium.PreRegisterPatientTest)  Time elapsed: 3.324 sec  <<< ERROR!
    org.openqa.selenium.NoSuchElementException: 
    Unable to locate element with ID: preregister_link
    For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
    Build info: version: '2.25.0', revision: '17482', time: '2012-07-18 22:18:01'
    System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.15.7', java.version: '1.8.0_261'
    Driver info: driver.version: HtmlUnitDriver
    	at edu.ncsu.csc.itrust.selenium.PreRegisterPatientTest.goToPreRegister(PreRegisterPatientTest.java:28)
    	at edu.ncsu.csc.itrust.selenium.PreRegisterPatientTest.testMissingElements(PreRegisterPatientTest.java:53)
    
    testPreRegisterPatientButton(edu.ncsu.csc.itrust.selenium.PreRegisterPatientTest)  Time elapsed: 3.426 sec  <<< ERROR!
    org.openqa.selenium.NoSuchElementException: 
    Unable to locate element with ID: preregister_link
    For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
    Build info: version: '2.25.0', revision: '17482', time: '2012-07-18 22:18:01'
    System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.15.7', java.version: '1.8.0_261'
    Driver info: driver.version: HtmlUnitDriver
    	at edu.ncsu.csc.itrust.selenium.PreRegisterPatientTest.goToPreRegister(PreRegisterPatientTest.java:28)
    	at edu.ncsu.csc.itrust.selenium.PreRegisterPatientTest.testPreRegisterPatientButton(PreRegisterPatientTest.java:32)
    
    testInvalidEmail(edu.ncsu.csc.itrust.selenium.PreRegisterPatientTest)  Time elapsed: 3.83 sec  <<< ERROR!
    org.openqa.selenium.NoSuchElementException: 
    Unable to locate element with ID: preregister_link
    For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
    Build info: version: '2.25.0', revision: '17482', time: '2012-07-18 22:18:01'
    System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.15.7', java.version: '1.8.0_261'
    Driver info: driver.version: HtmlUnitDriver
    	at edu.ncsu.csc.itrust.selenium.PreRegisterPatientTest.goToPreRegister(PreRegisterPatientTest.java:28)
    	at edu.ncsu.csc.itrust.selenium.PreRegisterPatientTest.testInvalidEmail(PreRegisterPatientTest.java:91)
    
    
    Results :
    
    Tests in error: 
      PreRegisterPatientTest.testInvalidEmail:91->goToPreRegister:28 » NoSuchElement
      PreRegisterPatientTest.testInvalidName:77->goToPreRegister:28 » NoSuchElement ...
      PreRegisterPatientTest.testMissingElements:53->goToPreRegister:28 » NoSuchElement
      PreRegisterPatientTest.testPreRegisterPatientButton:32->goToPreRegister:28 » NoSuchElement
      PreRegisterPatientTest.testPreRegisterPatientSuccessRequired:37->goToPreRegister:28 » NoSuchElement
    
    Tests run: 5, Failures: 0, Errors: 5, Skipped: 0
    
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time:  46.854 s
    [INFO] Finished at: 2020-11-06T19:01:04-08:00
    [INFO] ------------------------------------------------------------------------
  • Author Maintainer

    Ok so the way I got it to work was running mvn install -DskipTests so that it builds and deploys. After this, the tests seem to pass. Do you guys know if this is the expected behavior?

    Update: I think this is expected, because when I run just mvn install from a clean build it works (all tests pass). Let me know if you guys are able to replicate this.

    Edited by adityab3
  • I got BUILD SUCCESS after mvn install -DskipTests but I'm still getting a build failure with mvn test @htmoss2 Does it work for you?

    Edited by elengik2
  • I just tested and had the same results as @adityab3. After running mvn install -DskipTests, both of the specific tests passed with zero errors and zero failures so it looks good to me.

  • htmoss2 approved this merge request

    approved this merge request

  • merged

  • htmoss2 mentioned in commit c0a5d37e

    mentioned in commit c0a5d37e

  • elengik2 changed milestone to %Iteration 1

    changed milestone to %Iteration 1

Please register or sign in to reply
Loading