001    package org.cocome.tradingsystem.systests.scenarios;
002    
003    import java.util.concurrent.TimeoutException;
004    
005    /**
006     * This test covers use case 2 (ManageExpressCheckout). The system is put to
007     * express mode, afterwards express mode lights must be switched on and credit
008     * card payment is disabled.
009     * <p>
010     * This test checks that credit card payment is not possible anymore.
011     * 
012     * @author Christian Pfaller
013     * @author $Author: hummel $
014     * @version $Revision: 1.1 $
015     * @lev.rating GREEN Rev: 64
016     */
017    
018    public class ManageExpressCheckoutTest extends ManageExpressCheckoutBase {
019    
020            /** {@inheritDoc} */
021            @Override
022            public void testScenario() throws Exception {
023    
024                    initializeCashDesk(0, 0);
025    
026                    putCashDeskInExpressMode();
027    
028                    checkNotificationOfExpressMode();
029    
030                    checkExpressModeLightsOn();
031    
032                    tryDeactivatedCreditCardPayment();
033    
034                    // 5. The system sets maximum of items per sale to 8
035                    // --> no check implementet so far,
036                    // not defined what's the system corret reaction
037    
038            }
039    
040            /** Executes actions to confirm credit card payment is inactive */
041            private void tryDeactivatedCreditCardPayment() throws Exception,
042                            TimeoutException {
043                    // 4. The system deactivates the possibility for paying
044                    // by credit card
045    
046                    // first do a new sale
047                    startNewSale(1);
048                    enterProducts(1);
049                    finishSale();
050    
051                    // try payment by card - exception to use case
052                    cashBox.startCreditCardPayment();
053    
054                    // message should be displayed
055                    cashDesk.getUserDisplay().waitForUpdate(500);
056                    assertTrue(
057                                    "Message 'payment by credit card not possible' should be shown",
058                                    cashDesk.getUserDisplay()
059                                                    .isMessageForCreditCardNotPossibleShown());
060            }
061    
062    }