'use strict';

var User = require('../../lib/user');
var helper = require('../../lib/css-selector-builder');
var Logger = require('logb').getLogger(module.filename);


function reviewTitleSkuUser(opts) {
  opts = opts || {};
  User.call(this, opts);
}

reviewTitleSkuUser.prototype = new User();


// this command is used to get the id of an object inside the test-db database
// mongo localhost:27100/test-db
// db.products.findOne({productName:/at620/gi})._id

reviewTitleSkuUser.prototype.gotToReviewTitleSku = function(productId) {
  var self = this;
  return this.goTo('/products/'+productId+'/review-title-sku')
    .then(function() {
      var el = self.browser.element(by.css('.PRTSView-componentsContainer'));
      return self.waitForVisibleElement($('.PRTSView-componentsContainer'));
    })
    .then(function() {
      return self.takeScreenshot('just-went-to-reviewTitleSku');
    });
};


module.exports = reviewTitleSkuUser;