SlideShare une entreprise Scribd logo
1  sur  16
UI Testing with Protractor 
Andrew Eisenberg 
Tasktop Technologies
About me 
• PhD from UBC 
• SpringSource/VMware/Pivotal 
– Spring, Groovy, AspectJ, JS (IDE and languages) 
• Tasktop 
– Platform and Apps teams
Kinds of testing 
• Unit testing 
• Integration testing 
– UI Testing 
• System testing 
Using Protractor
How Protractor works 
• Selenium Server to manage browsers 
• Selenium WebDriver to invoke browser APIs 
• Protractor node app to run tests 
• Jasmine, etc as test framework
How to run Protractor 
• Protractor config file: 
exports.config = { 
onPrepare: function () { … }, 
capabilities: {'browserName’:'firefox’}, 
specs: ['../tests/*.spec.js'], 
baseUrl: 'http://localhost:8080/’, 
jasmineNodeOpts: { … }, 
// and many more options 
} 
• To launch: 
protractor protractor.conf.js
The first test 
describe('HomePage', function () { 
it('should be the default page', 
function () { 
browser.get(browser.baseUrl); 
expect(browser 
.getCurrentUrl()) 
.toEqual(browser.baseUrl 
+ 'projectsinfo'); 
}); 
});
The PageObject pattern 
• Models the services exported by a page 
LoginPage.prototype = { 
isLoggedIn : function() { … }, 
logout : function() { … }, 
login : function() { … }, 
cancelLogin : function() { … } 
}
Secretly, everything is a promise
Debugging! 
Add to script: 
browser.debugger(); 
Launch in debug mode: 
protractor debug protractor.conf.js
SOME THINGS I LEARNED
Avoid complex selectors 
Bad 
element(by.cssContainingText(‘table.data tr.user td.name’, 
‘Jane’); 
element(by.repeater(‘option as option.label for option in 
field.options track by (option.value + option.label)’); 
Good 
element(by.cssContainingText(‘.name’, ‘Jane’); 
element(by.css (‘#name-Jane’); 
element(by.css(‘#options’));
Selectors are brittle 
• ids most stable 
– easy to fix when they change 
– consider dynamically generated ids 
• but be careful they are always valid and unique 
– Should be namespaced by directive 
• but…what if directive repeated multiple times? 
• OK to refactor base code 
– make it more testable 
– expose ids
Impossible to test everything 
• Too many corner cases 
• Happy path 
• A few corner cases 
• Any interesting interactions 
• More complex tests are more brittle 
• Trade-off: 
– time spent writing/maintaining tests vs code
Your tests will be 
Incomplete and 
Brittle 
Deal with it.
State & Reproducibility 
• Better to test against clean state 
• Better to tear down before each test 
• Can be slow to clean 
• Tests should not make assumptions about 
clean state
UI Testing with Protractor 
Andrew Eisenberg 
Twitter: @werdnagreb

Contenu connexe

Tendances

Development of automated tests for ext js based web sites
Development of automated tests for ext js based web sitesDevelopment of automated tests for ext js based web sites
Development of automated tests for ext js based web sites
ISsoft
 

Tendances (20)

Automated Web Testing using JavaScript
Automated Web Testing using JavaScriptAutomated Web Testing using JavaScript
Automated Web Testing using JavaScript
 
Protractor overview
Protractor overviewProtractor overview
Protractor overview
 
Protractor end-to-end testing framework for angular js
Protractor   end-to-end testing framework for angular jsProtractor   end-to-end testing framework for angular js
Protractor end-to-end testing framework for angular js
 
Workshop - E2e tests with protractor
Workshop - E2e tests with protractorWorkshop - E2e tests with protractor
Workshop - E2e tests with protractor
 
Protractor for angularJS
Protractor for angularJSProtractor for angularJS
Protractor for angularJS
 
Marcin Wasilczyk - Page objects with selenium
Marcin Wasilczyk - Page objects with seleniumMarcin Wasilczyk - Page objects with selenium
Marcin Wasilczyk - Page objects with selenium
 
Automated Smoke Tests with Protractor
Automated Smoke Tests with ProtractorAutomated Smoke Tests with Protractor
Automated Smoke Tests with Protractor
 
Automated Testing using JavaScript
Automated Testing using JavaScriptAutomated Testing using JavaScript
Automated Testing using JavaScript
 
Join the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.jsJoin the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.js
 
Insights on Protractor testing
Insights on Protractor testingInsights on Protractor testing
Insights on Protractor testing
 
Browser Automated Testing Frameworks - Nightwatch.js
Browser Automated Testing Frameworks - Nightwatch.jsBrowser Automated Testing Frameworks - Nightwatch.js
Browser Automated Testing Frameworks - Nightwatch.js
 
Jellyfish, JSCONF 2011
Jellyfish, JSCONF 2011Jellyfish, JSCONF 2011
Jellyfish, JSCONF 2011
 
TestingAR XX - Protractor e2e Test Framework - Introduction what we have lear...
TestingAR XX - Protractor e2e Test Framework - Introduction what we have lear...TestingAR XX - Protractor e2e Test Framework - Introduction what we have lear...
TestingAR XX - Protractor e2e Test Framework - Introduction what we have lear...
 
Automated Testing in Angular Slides
Automated Testing in Angular SlidesAutomated Testing in Angular Slides
Automated Testing in Angular Slides
 
Introduction to Protractor
Introduction to ProtractorIntroduction to Protractor
Introduction to Protractor
 
Automated Testing with Cucumber, PhantomJS and Selenium
Automated Testing with Cucumber, PhantomJS and SeleniumAutomated Testing with Cucumber, PhantomJS and Selenium
Automated Testing with Cucumber, PhantomJS and Selenium
 
Testing nightwatch, by David Torroija
Testing nightwatch, by David TorroijaTesting nightwatch, by David Torroija
Testing nightwatch, by David Torroija
 
Webdriver.io
Webdriver.io Webdriver.io
Webdriver.io
 
Automation using Javascript
Automation using JavascriptAutomation using Javascript
Automation using Javascript
 
Development of automated tests for ext js based web sites
Development of automated tests for ext js based web sitesDevelopment of automated tests for ext js based web sites
Development of automated tests for ext js based web sites
 

En vedette

How to Analyze Reports in Jmeter
How to Analyze Reports in JmeterHow to Analyze Reports in Jmeter
How to Analyze Reports in Jmeter
Viviana Lesmes
 
Triangle and its properties
Triangle and its propertiesTriangle and its properties
Triangle and its properties
Azam Khan
 

En vedette (20)

Introduction to Protractor
Introduction to ProtractorIntroduction to Protractor
Introduction to Protractor
 
Protractor powerpoint
Protractor powerpointProtractor powerpoint
Protractor powerpoint
 
Sharing the pain using Protractor
Sharing the pain using ProtractorSharing the pain using Protractor
Sharing the pain using Protractor
 
Testing in AngularJS
Testing in AngularJSTesting in AngularJS
Testing in AngularJS
 
Triangles
TrianglesTriangles
Triangles
 
Classifying Triangles
Classifying TrianglesClassifying Triangles
Classifying Triangles
 
Triangle and its properties
Triangle and its propertiesTriangle and its properties
Triangle and its properties
 
Around The World In 80 Days
Around The World In 80 DaysAround The World In 80 Days
Around The World In 80 Days
 
Load Testing with JMeter
Load Testing with JMeterLoad Testing with JMeter
Load Testing with JMeter
 
Angularjs - Unit testing introduction
Angularjs - Unit testing introductionAngularjs - Unit testing introduction
Angularjs - Unit testing introduction
 
Apache JMeter - A brief introduction
Apache JMeter - A brief introductionApache JMeter - A brief introduction
Apache JMeter - A brief introduction
 
How to Analyze Reports in Jmeter
How to Analyze Reports in JmeterHow to Analyze Reports in Jmeter
How to Analyze Reports in Jmeter
 
Performance testing and reporting with JMeter
Performance testing and reporting with JMeterPerformance testing and reporting with JMeter
Performance testing and reporting with JMeter
 
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - DOSUG February 2016
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - DOSUG February 2016Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - DOSUG February 2016
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - DOSUG February 2016
 
Sun, Moon, And Earth Powerpoint
Sun, Moon, And Earth PowerpointSun, Moon, And Earth Powerpoint
Sun, Moon, And Earth Powerpoint
 
Perils of Page-Object Pattern
Perils of Page-Object PatternPerils of Page-Object Pattern
Perils of Page-Object Pattern
 
Test Data - Food for your Test Automation Framework
Test Data - Food for your Test Automation FrameworkTest Data - Food for your Test Automation Framework
Test Data - Food for your Test Automation Framework
 
Interpreting Performance Test Results
Interpreting Performance Test ResultsInterpreting Performance Test Results
Interpreting Performance Test Results
 
Triangle and its properties
Triangle and its propertiesTriangle and its properties
Triangle and its properties
 
Types of Polygons
Types of PolygonsTypes of Polygons
Types of Polygons
 

Similaire à Angular UI Testing with Protractor

Automating Django Functional Tests Using Selenium on Cloud
Automating Django Functional Tests Using Selenium on CloudAutomating Django Functional Tests Using Selenium on Cloud
Automating Django Functional Tests Using Selenium on Cloud
Jonghyun Park
 
Selenium Introduction by Sandeep Sharda
Selenium Introduction by Sandeep ShardaSelenium Introduction by Sandeep Sharda
Selenium Introduction by Sandeep Sharda
Er. Sndp Srda
 
Intro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiIntro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran Mizrahi
Ran Mizrahi
 

Similaire à Angular UI Testing with Protractor (20)

Java script unit testing
Java script unit testingJava script unit testing
Java script unit testing
 
Selenium
SeleniumSelenium
Selenium
 
Testing Ext JS and Sencha Touch
Testing Ext JS and Sencha TouchTesting Ext JS and Sencha Touch
Testing Ext JS and Sencha Touch
 
Node.js vs Play Framework (with Japanese subtitles)
Node.js vs Play Framework (with Japanese subtitles)Node.js vs Play Framework (with Japanese subtitles)
Node.js vs Play Framework (with Japanese subtitles)
 
[DN Scrum Breakfast] Protractor: E2E Testing for AngularJS (by Thuy Nguyen)
[DN Scrum Breakfast] Protractor: E2E Testing for AngularJS (by Thuy Nguyen)[DN Scrum Breakfast] Protractor: E2E Testing for AngularJS (by Thuy Nguyen)
[DN Scrum Breakfast] Protractor: E2E Testing for AngularJS (by Thuy Nguyen)
 
full-stack-webapp-testing-with-selenium-and-rails.pdf
full-stack-webapp-testing-with-selenium-and-rails.pdffull-stack-webapp-testing-with-selenium-and-rails.pdf
full-stack-webapp-testing-with-selenium-and-rails.pdf
 
Browser testing with nightwatch.js - Drupal Europe
Browser testing with nightwatch.js - Drupal EuropeBrowser testing with nightwatch.js - Drupal Europe
Browser testing with nightwatch.js - Drupal Europe
 
jQuery Performance Tips and Tricks
jQuery Performance Tips and TricksjQuery Performance Tips and Tricks
jQuery Performance Tips and Tricks
 
Automating Django Functional Tests Using Selenium on Cloud
Automating Django Functional Tests Using Selenium on CloudAutomating Django Functional Tests Using Selenium on Cloud
Automating Django Functional Tests Using Selenium on Cloud
 
Selenium Introduction by Sandeep Sharda
Selenium Introduction by Sandeep ShardaSelenium Introduction by Sandeep Sharda
Selenium Introduction by Sandeep Sharda
 
Escaping Test Hell - ACCU 2014
Escaping Test Hell - ACCU 2014Escaping Test Hell - ACCU 2014
Escaping Test Hell - ACCU 2014
 
selenium.ppt
selenium.pptselenium.ppt
selenium.ppt
 
Quick tour to front end unit testing using jasmine
Quick tour to front end unit testing using jasmineQuick tour to front end unit testing using jasmine
Quick tour to front end unit testing using jasmine
 
Intro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiIntro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran Mizrahi
 
Selenium testing - Handle Elements in WebDriver
Selenium testing - Handle Elements in WebDriver Selenium testing - Handle Elements in WebDriver
Selenium testing - Handle Elements in WebDriver
 
selenium.ppt
selenium.pptselenium.ppt
selenium.ppt
 
selenium.ppt
selenium.pptselenium.ppt
selenium.ppt
 
Ember.js Brussels Meetup #3 - Testing your Ember.js app
Ember.js Brussels Meetup #3 - Testing your Ember.js appEmber.js Brussels Meetup #3 - Testing your Ember.js app
Ember.js Brussels Meetup #3 - Testing your Ember.js app
 
Jest: Frontend Testing leicht gemacht @EnterJS2018
Jest: Frontend Testing leicht gemacht @EnterJS2018Jest: Frontend Testing leicht gemacht @EnterJS2018
Jest: Frontend Testing leicht gemacht @EnterJS2018
 
Unit testing with Spock Framework
Unit testing with Spock FrameworkUnit testing with Spock Framework
Unit testing with Spock Framework
 

Dernier

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 

Dernier (20)

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 

Angular UI Testing with Protractor

  • 1. UI Testing with Protractor Andrew Eisenberg Tasktop Technologies
  • 2. About me • PhD from UBC • SpringSource/VMware/Pivotal – Spring, Groovy, AspectJ, JS (IDE and languages) • Tasktop – Platform and Apps teams
  • 3. Kinds of testing • Unit testing • Integration testing – UI Testing • System testing Using Protractor
  • 4. How Protractor works • Selenium Server to manage browsers • Selenium WebDriver to invoke browser APIs • Protractor node app to run tests • Jasmine, etc as test framework
  • 5. How to run Protractor • Protractor config file: exports.config = { onPrepare: function () { … }, capabilities: {'browserName’:'firefox’}, specs: ['../tests/*.spec.js'], baseUrl: 'http://localhost:8080/’, jasmineNodeOpts: { … }, // and many more options } • To launch: protractor protractor.conf.js
  • 6. The first test describe('HomePage', function () { it('should be the default page', function () { browser.get(browser.baseUrl); expect(browser .getCurrentUrl()) .toEqual(browser.baseUrl + 'projectsinfo'); }); });
  • 7. The PageObject pattern • Models the services exported by a page LoginPage.prototype = { isLoggedIn : function() { … }, logout : function() { … }, login : function() { … }, cancelLogin : function() { … } }
  • 9. Debugging! Add to script: browser.debugger(); Launch in debug mode: protractor debug protractor.conf.js
  • 10. SOME THINGS I LEARNED
  • 11. Avoid complex selectors Bad element(by.cssContainingText(‘table.data tr.user td.name’, ‘Jane’); element(by.repeater(‘option as option.label for option in field.options track by (option.value + option.label)’); Good element(by.cssContainingText(‘.name’, ‘Jane’); element(by.css (‘#name-Jane’); element(by.css(‘#options’));
  • 12. Selectors are brittle • ids most stable – easy to fix when they change – consider dynamically generated ids • but be careful they are always valid and unique – Should be namespaced by directive • but…what if directive repeated multiple times? • OK to refactor base code – make it more testable – expose ids
  • 13. Impossible to test everything • Too many corner cases • Happy path • A few corner cases • Any interesting interactions • More complex tests are more brittle • Trade-off: – time spent writing/maintaining tests vs code
  • 14. Your tests will be Incomplete and Brittle Deal with it.
  • 15. State & Reproducibility • Better to test against clean state • Better to tear down before each test • Can be slow to clean • Tests should not make assumptions about clean state
  • 16. UI Testing with Protractor Andrew Eisenberg Twitter: @werdnagreb